odyniec / imgareaselect

ImgAreaSelect is a jQuery plugin for selecting a rectangular area of an image. It allows web developers to easily implement image cropping functionality, as well as other user interface features, such as photo notes (like those on Flickr).
http://odyniec.net/projects/imgareaselect/
686 stars 197 forks source link

selection area wouldn't rebuild after call remove and reinit. #35

Open dodgepudding opened 11 years ago

dodgepudding commented 11 years ago

after release the instance using function "remove()" then rebuild imgAreaSelect, the selection area DIV will disappear. the code like this:

editorhandle = $('#cropimg').imgAreaSelect({ handles: true, instance: true, show: true, imageHeight: 400, imageWidth: 400, x1:0,y1:0,x2:200,y2:200 }); //you can see selection area showed. //then release and rebuild immediately editorhandle.remove(); editorhandle = $('#cropimg').imgAreaSelect({ handles: true, instance: true, show: true, imageHeight: 400, imageWidth: 400, x1:0,y1:0,x2:200,y2:200 }); //selection area DIVs disappeared, but you can even crop the image.