An example JQuery sortable snippet:
$("#sortable").sortable({
start: function(){ $('#overlay').show('fast'); });
stop: function(){ $('#overlay').hide('fast'); });
revert: true;
});
I’d like my overlay to at least start hiding BEFORE the revert animation begins, because it feels slow otherwise. Any ideas?
Unfortunately, the revert animation is executed before the internal
_clear()function is executed which triggers the eventsbeforeStopandstop.A possible workaround is to provide a number for the
revertoption instead of a boolean. From the documentation:So you can set a smaller revert animation duration, for instance 150ms, so it does not look too slow:
In complement, you could replace the
stopevent by defining define a one-timemouseupevent on the helper when you start the dragging, in which you will start hiding your#overlayelement. As soon as the mouse button is released, the handler will be executed along with the revert animation:DEMO