0

我如何检测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
}
4

1 回答 1

0
el = $('.ele');

if(!el.hasClass('scrolling')) {
    el.addClass('scrolling');
    $.scrollTo( '#xxx', 1000, {onAfter: function() { el.removeClass('scrolling'); }});
}
于 2013-02-26T17:12:15.843 回答