Question

I am trying to add a delay between when the user drags and drops the div, and when the div reverts back.

so upon mouse up, to when the revert action begins I would like to have a short delay.

Here the jQuery:

$( "#draggable" ).draggable({  revert: true , revertDuration: 1000 });

and here is a fiddle http://jsfiddle.net/YxBP9/54/

Était-ce utile?

La solution

You can custom revert function then return true to revert that item in revert option

  $( "#draggable" ).draggable({  revert: function(){$(this).delay(1000);return true;} , revertDuration: 1000 });

Hope this help,

Here some fiddle, http://jsfiddle.net/YxBP9/73/

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top