如何检测scrollTo插件当前是否滚动?像jQuery :animated
选择器。
if ( $('.ele').is(':animated') ) {
$('.ele').animate({'left':'1000px'},5000);
// .ele will only animate while it is not animating
// i prevent repeat animation
}
答案 0 :(得分:0)
el = $('.ele');
if(!el.hasClass('scrolling')) {
el.addClass('scrolling');
$.scrollTo( '#xxx', 1000, {onAfter: function() { el.removeClass('scrolling'); }});
}