Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 266
Peter Coulton Avatar asked Jun 14 '09 22:06

Peter Coulton


1 Answers

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.

like image 109
Alconja Avatar answered Nov 10 '22 12:11

Alconja