I found a solution to fix it getting the top position of the parent div using offset()
and add it to the containment boundary. I'm not sure it's the best solution but it looks like it's working.
I just have a difference of 1%
in the offset at the top which is quite annoying: if you drag the image and make it stick to the top as much as possible it returns 99%
offset instead of 100%
(see the result in the console).
The bottom one is correct (0%
). I think it's due to rounding the size but I'm not sure.
Here is the jsfiddle: http://jsfiddle.net/maxwell2022/DerNa/167/
If you have a better idea please, please, let me know.
Thanks, Maxime