优化滚动

This commit is contained in:
2012-11-28 16:59:20 +08:00
parent a89fc28bba
commit a86401f434

View File

@@ -1 +1 @@
;(function(e){e.fn.extend({autoScroll:function(t){function s(){var t=r.find("ul:first"),n=t.find("li:first");if(i.type==="H"){var s=-n.outerWidth(!0)+"px";t.animate({marginLeft:s},800,function(){e(this).css({marginLeft:"0px"}).find("li:first").appendTo(this)})}else{var o=-n.outerHeight(!0)+"px";t.animate({marginTop:o},800,function(){e(this).css({marginTop:"0px"}).find("li:first").appendTo(this)})}}var n=null,r=this,i={type:"V",timer:5e3};return t=t||{},e.extend(i,t),n=setInterval(s,i.timer),r.each(function(){e(this).hover(function(){clearInterval(n)},function(){n=setInterval(s,i.timer)})})}})})(jQuery)
;(function(e){e.fn.extend({autoScroll:function(t){function s(){var t=r.find("ul:first"),n=t.find("li:first");if(i.type==="H"){var s=-n.outerWidth(!0)+"px";t.animate({marginLeft:s},800,function(){e(this).css({marginLeft:"0px"}).find("li:first").appendTo(this)})}else{var o=-n.outerHeight(!0)+"px";t.animate({marginTop:o},800,function(){e(this).css({marginTop:"0px"}).find("li:first").appendTo(this)})}}var n=null,r=this,i={type:"V",timer:5e3};return t=t||{},e.extend(i,t),n=setInterval(s,i.timer),r.each(function(){e(this).hover(function(){clearInterval(n)},function(){clearInterval(n);n=setInterval(s,i.timer)})})}})})(jQuery)