jquery ui draggable containment

jquery ui draggable containment

I have a project where i need to be able to drag an image around within a div, however the image needs to be constrained in such a way that it never gets dragged completely out of the div. the catch is that the image gets zoomed in and out, so after zooming i have to reset the constraints. fine.

However, my constraints seem to be getting based on the document, is there a way to constrain based on the position of the image inside it's parent, while still allowing the image to be dragged, say, 90% outside of its parent? the parent already has a position: relative;

it would also be great if i could setup my constraints with a % value so that i don't have to re-calculate it every time i resize the image, however i can get by without that.

-- Kevin

------------------------------------------------
http://www.tentonaxe.com - jQuery Snippets and Tutorials