1

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

Ant
  • 336
  • 1
  • 3
  • 14
  • Did you code the slider on your own or did you use the jQuery UI Slide? A simplified [jsfiddle](http://www.jsfiddle.net) would be a great helper to work on your problem. Or at least some code is really helpful – SirDerpington May 08 '13 at 19:50

0 Answers0