-1

I have written a workable version of Solitaire using Jquery's draggable and droppable functions. To capture all the cards I'm dragging I drag the div they reside in. After the drop routine the div reverts to its original position on the board. The problem is that the card(s) are changed in the drop routine so you see the changed card(s) floating back across the board to the original position.

I can hide the helper (which is the original image) with ui.helper.hide() and re-show it with ui.helper.show(), but there's still a delay time - the time it takes the div to move back.

I need to either change the revert time to 0 or force the div back to its original position to remove the delay, and I can't seem to figure out how to do that.

Can anyone help me?

Wade Bear
  • 1
  • 1

1 Answers1

3

You can use the revertDuration

The duration of the revert animation, in milliseconds. Ignored if the revert option is false.

$( ".selector" ).draggable({
  revertDuration: 0
});
Juan
  • 4,910
  • 3
  • 37
  • 46
  • I tried changing the revertDuration to 0 in the DROP function. It doesn't seem to work. – Wade Bear Aug 01 '15 at 18:55
  • 1
    But what you said made me look at my program again... I'd forgotten that I was manually reverting so all I had to do was change the animation time to 0. Thank you. – Wade Bear Aug 01 '15 at 19:07