質問

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/

役に立ちましたか?

解決

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/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top