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

Update jquery.imgareaselect.dev.js #69

Open eliyahen1 opened 10 years ago

eliyahen1 commented 10 years ago

https://github.com/odyniec/imgareaselect/issues/39

It seems that the position of $outer parts are set to fixed when any of the IMG parents is fixed. This is true when you refer relatively to the body element. But, if you set parent to an explicit element, and no fixed position is in between IMG element and parent element - the position of $outer should be 'absolute'.

Problem is, you determine and set the $outer position before you setSettings. So, the solution is to re-set it after you set options.

I ended up with this change: In imgLoad function: $box.add($outer).css({ visibility: '' , position: ($parent[0].tagName !== 'BODY'? 'absolute' : undefined) });