Вот кусок кода.
var intervalLeft;
var intervalRight;
$(function() {
$(".iconaria ").sortable({
connectWith: ".iconaria",
scroll: false,
sort: function(event, ui) {
listItem = $('.ls-nav-active');
ind = $('.ls-bottom-slidebuttons a').index(listItem);
var browserWindow = $(window);
var width = browserWindow.width();
if (event.pageX < (width*(ind))+30) {
intervalLeft = setInterval(function(){ shft(ind-1) },2000);
} else { clearInterval(intervalLeft); }
if (event.pageX > (width*ind)+width-30) {
intervalRight = setInterval(function(){ shft(ind+2) },2000);
} else {clearInterval(intervalRight); }
},
stop: function(event, ui) { mDownmMow(); clearInterval(intervalLeft); clearInterval(intervalRight);
}
});
$(".iconaria").disableSelection();
});