Cropper
A simple jQuery image cropping plugin. As of v4.0.0, the core code of Cropper is replaced with Cropper.js.
- Demo
- Cropper.js - JavaScript image cropper (recommended)
- jquery-cropper - A jQuery plugin wrapper for Cropper.js (recommended for jQuery users to use this instead of Cropper)
Main
dist/├── cropper.css├── cropper.min.css (compressed)├── cropper.js (UMD)├── cropper.min.js (UMD, compressed)├── cropper.common.js (CommonJS, default)└── cropper.esm.js (ES Module)
Getting started
Installation
npm install cropper jquery
Include files:
<!-- jQuery is required -->
Usage
Initialize with $.fn.cropper
method.
<!-- Wrap the image or canvas element with a block element (container) -->
/* Limit image width to avoid overflow the container */
var $image = ; $image; // Get the Cropper.js instance after initializedvar cropper = $imagedata'cropper';
Options
See the available options of Cropper.js.
;
Methods
See the available methods of Cropper.js.
;
Events
See the available events of Cropper.js.
;
No conflict
If you have to use other plugin with the same namespace, just call the $.fn.cropper.noConflict
method to revert to it.
Browser support
It is the same as the browser support of Cropper.js. As a jQuery plugin, you also need to see the jQuery Browser Support.
Contributing
Please read through our contributing guidelines.
Versioning
Maintained under the Semantic Versioning guidelines.