Peter Coulton
Peter Coulton

Reputation: 55789

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?

Upvotes: 12

Views: 7335

Answers (1)

Alconja
Alconja

Reputation: 14873

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.

Upvotes: 26

Related Questions