This small mootools plugin to drag picture inside a small box to get a thumbnail showing the good part of the picture, then return values [Top, Left, Width, Height] of picture relative to the box (Like facebook).
MooTools More 1.2.4: Drag.* (and its dependencies)
An element parent where the picture shoud be shild, this element(div) must have a fixed With/height and Overflow:hidden
new Drag2Crop('pictureId', { setOptions : { relative : 'relative' // Box id }, onStart : function(){ this.picture.setStyles({opacity:0.5}); }, onDone : function(top,left){ this.picture.setStyles({opacity:1}); alert('text', 'Top : ' + top + ' | Left : ' + left); } });
See http://updel.com/drag2crop/ for more information.
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus