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

Latest commit

 

History

History
36 lines (21 loc) · 545 Bytes

Readme.md

File metadata and controls

36 lines (21 loc) · 545 Bytes

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