I was wondering how you changed the "revert" property of something being dragged in Jquery ui from the stop event.
$('.things').draggable({
revert: "true",
stop: function(event, ui){
//if something then set revert to false
}
});
I've tried a few things but I can't seem to get it to work.
Cheers.
The stop
event occurs too late for changes to the revert
option to affect the current drag operation. The draggable will still revert, even if it won't do so anymore in the next drags.
You might want to bind to the drag event instead:
$('.things').draggable({
revert: true,
drag: function(event, ui) {
if (/* something */) {
$(this).draggable("option", "revert", false);
}
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With