Drag2Crop crop

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

Demo

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



Details

Author
Abdelkader Elkalidi
Current version
crop
GitHub
updel/Drag2Crop
Downloads
6736
Category
Widgets
Tags
Report
GitHub Issues

Releases


Dependencies

  • core/1.2.4: *
  • more/1.2.4: Drag.*

How to use

Requires

  • 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

    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.


Discuss

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