Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

yields/crop

Repository files navigation

crop

Image cropper

Installation

$ component install yields/crop

Example

var cropper = require('crop')(element);
cropper.build();
cropper.on('crop', function(d){
  console.log(d); // > { left: 10, top: 10, height: 100, width: 100 }
});

API

cropper(el[, opts])

Create a new Cropper instance with el and optional opts object.

cropper.build()

Build (render) the crop area on el and bind all events.

cropper.destroy()

destroy the crop-area and unbind all events.

License

MIT