Jquery Cropper

A jQuery plugin wrapper for Cropper.js.
Alternatives To Jquery Cropper
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Selectize.js12,93360010525 days ago7July 12, 201851apache-2.0SCSS
Selectize is the hybrid of a textbox and <select> box. It's jQuery based, and it has autocomplete and native-feeling keyboard navigation; useful for tagging, contact lists, etc.
Bootstrap Fileinput5,2581,182353 months ago89August 17, 202214otherJavaScript
An enhanced HTML 5 file input for Bootstrap 5.x/4.x./3.x with file preview, multiple selection, and more features.
Jstree5,0173981164 months ago28September 03, 20212mitJavaScript
jquery tree plugin
Jquery Mask Plugin4,651250576 months ago30July 31, 2019118otherJavaScript
A jQuery Plugin to make masks on form fields and HTML elements.
Unveil4,272
3 years ago1February 03, 2015106JavaScript
A very lightweight jQuery plugin to lazy load images
Malihu Custom Scrollbar Plugin4,110299492 years ago11July 10, 2016412otherJavaScript
Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support etc.
Jquery Placeholder4,07312093 years ago4January 12, 201629mitJavaScript
A jQuery plugin that enables HTML5 placeholder behavior for browsers that aren’t trying hard enough yet
Animsition3,7492114 years ago8April 26, 201676mitCSS
A simple and easy jQuery plugin for CSS animated page transitions.
Bootstrap Multiselect3,62082212 months ago4August 01, 2021302otherHTML
JQuery multiselect plugin based on Twitter Bootstrap.
Jquery Match Height3,086491265 years ago4February 19, 201778mitJavaScript
a responsive equal heights plugin
Alternatives To Jquery Cropper
Select To Compare


Alternative Project Comparisons
Readme

jquery-cropper

Build Status Coverage Status Downloads Version

A jQuery plugin wrapper for Cropper.js.

Main

dist/
├── jquery-cropper.js        (UMD)
├── jquery-cropper.min.js    (UMD, compressed)
├── jquery-cropper.common.js (CommonJS, default)
└── jquery-cropper.esm.js    (ES Module)

Getting started

Installation

npm install jquery-cropper jquery cropperjs

Include files:

<script src="/path/to/jquery.js"></script><!-- jQuery is required -->
<script src="/path/to/cropper.js"></script><!-- Cropper.js is required -->
<link  href="/path/to/cropper.css" rel="stylesheet">
<script src="/path/to/jquery-cropper.js"></script>

Usage

Initialize with $.fn.cropper method.

<!-- Wrap the image or canvas element with a block element (container) -->
<div>
  <img id="image" src="picture.jpg">
</div>
/* Limit image width to avoid overflow the container */
img {
  max-width: 100%; /* This rule is very important, please do not ignore this! */
}
var $image = $('#image');

$image.cropper({
  aspectRatio: 16 / 9,
  crop: function(event) {
    console.log(event.detail.x);
    console.log(event.detail.y);
    console.log(event.detail.width);
    console.log(event.detail.height);
    console.log(event.detail.rotate);
    console.log(event.detail.scaleX);
    console.log(event.detail.scaleY);
  }
});

// Get the Cropper.js instance after initialized
var cropper = $image.data('cropper');

Options

See the available options of Cropper.js.

$().cropper(options);

Methods

See the available methods of Cropper.js.

$().cropper('method', argument1, , argument2, ..., argumentN);

Events

See the available events of Cropper.js.

$().on('event', handler);

No conflict

If you have to use other plugin with the same namespace, just call the $.fn.cropper.noConflict method to revert to it.

<script src="other-plugin.js"></script>
<script src="jquery-cropper.js"></script>
<script>
  $.fn.cropper.noConflict();
  // Code that uses other plugin's "$().cropper" can follow here.
</script>

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.

License

MIT © Chen Fengyuan

Popular Plugin Projects
Popular Jquery Projects
Popular Libraries Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Javascript
Plugin
Jquery
Image Processing
Crop
Image Cropper