Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove animation on revert of jQuery UI draggable?

I tried Googling and couldn't find this, but I imagine it is a fairly simple task. I am trying to get rid of the revert animation (N.B. I want to keep the revert action, just want to remove the animation of it reverting) when you drop from the left side to the right side in this example : http://jsfiddle.net/2fsVZ/

Here is the long and short of what I am looking for:

Below is the JavaScript I am working with - how do I tell it to not animate the revert?

  $( ".before .left-side>div" ).draggable({ revert: true});
like image 622
matgargano Avatar asked Oct 17 '12 20:10

matgargano


1 Answers

You just need to set the revertDuration to 0.

$( ".before .left-side>div" ).draggable({
    revert: true,
    revertDuration: 0
});

http://jsfiddle.net/2fsVZ/2/

http://docs.jquery.com/UI/Draggable#option-revertDuration

like image 102
jholloman Avatar answered Oct 11 '22 05:10

jholloman