Files
emlog_lastRSS/js/jquery-autoscroll.js
2012-10-16 17:02:11 +08:00

1 line
609 B
JavaScript

;(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)