How can I get JQueryUI sortable to 'revert' faster?

Peter Coulton picture Peter Coulton · Jun 15, 2009 · Viewed 7k times · Source

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?

Answer

Alconja picture Alconja · Jun 15, 2009

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.