I have an image that I can drag around a container using jQuery UI.
I am using draggable("option", "containment", [x1, y1, x2, y2]) to set draggable containment which works perfectly.
I have written a zoom slider which zooms the image, then recalculates the containment which works perfectly as well.
However when I zoom out the image, it may sit outside of the newly calculated containment area, its position doesn't get updated until I start to drag again on the element, then it snaps within the containment area and I can continue to drag it.
I want the element's position to update as I zoom in out if it falls outside of the containment area. I was looking into simulating a drag event after zooming however I couldn't get it to work properly.
Is there any way of refreshing the position of the element using the jQuery UI Draggable plugin?
Thanks