views:

328

answers:

1

JQuery's sortable has an option to revert the item that the user drags back in line with the rest, but the animation is a little slow.

Is there a simple way to specify 'fast' like some of the other methods?

+6  A: 

It appears to be undocumented*, but setting the revert property to a number will treat that as the speed (or more specifically the duration in ms). So something like this gives a pretty quick revert animation:

$("#sortable").sortable({revert: 100});

(Aside: It's a pity they haven't kept it consistent with draggables, which use revertDuration to specify the speed of the revert.)

*Edit: It looks like in the latest version it is now an officially documented feature.

Alconja