Mootools class : drag picture inside box, to get a thumbnail showing the good part of the picture.
JavaScript
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Demo
Source
README.md
package.yml

README.md

Drag2Crop

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).

Screenshot

Demo

http://updel.com/demos/drag2crop/

How to use

Requires

  • An element parent where the picture shoud be shild, this element(div) must have a fixed With/height and Overflow:hidden

    #JS 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); } });

More Information

See http://updel.com/drag2crop/ for more information.