Reputation: 450
I'm using the jQuery UI Draggable interaction on the handle of a 2d slider. I use the Draggable "drag" event to update the position of the slider as it's being dragged.
The problem I'm having is that the drag event seems to fire before the element being dragged actually changes position. So, if you use the drag event to report the position of the element being dragged, it reports the position it's moved from, instead of the position it's moved onto.
I need to somehow get the data for the position the draggable element is being moved onto.
Any help would be much appreciated!
Upvotes: 0
Views: 577
Reputation: 26
Look up the position of the handle like this:
$('#handle').draggable({
drag: function(event,ui){
... ui.position ...
})
Upvotes: 1