【问题标题】:How to detect scrollTo plugin is currently scrolls?如何检测 scrollTo 插件当前是否滚动?
【发布时间】:2013-02-27 01:12:15
【问题描述】:

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

【问题讨论】:

    标签: jquery scrollto


    【解决方案1】:
    el = $('.ele');
    
    if(!el.hasClass('scrolling')) {
        el.addClass('scrolling');
        $.scrollTo( '#xxx', 1000, {onAfter: function() { el.removeClass('scrolling'); }});
    }
    

    【讨论】:

      猜你喜欢
      • 2011-03-19
      • 1970-01-01
      • 2015-06-20
      • 1970-01-01
      • 2011-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多