you can use the start and stop options:
$( ".selector" ).sortable({ start: function(event, ui) { ... }, stop: function(event, ui) { ... } });
Just create a flag and set it to true when sorting starts and false when sorting is over, and in your onclick function, first check the flag:
var isBeingSorted = false $( ".selector" ).sortable({ start: function(event, ui) { isBeingSorted = true; }, stop: function(event, ui) { isBeingSorted = false; } }); function printAlert(message){ if(!isBeingSorted) alert(message); }
And, of course, your onclicks should look like onclick="printAlert('sdfsdf')"
For more options, see here.
source share