Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何检测scrollTo插件当前滚动移动?像 jQuery:animated选择器。
:animated
if ( $('.ele').is(':animated') ) { $('.ele').animate({'left':'1000px'},5000); // .ele will only animate while it is not animating // i prevent repeat animation }
el = $('.ele'); if(!el.hasClass('scrolling')) { el.addClass('scrolling'); $.scrollTo( '#xxx', 1000, {onAfter: function() { el.removeClass('scrolling'); }}); }