// javascript document (function($){ $.fn.myscroll = function(options){ //榛樿閰嶇疆 var defaults = { speed:40, //婊氬姩閫熷害,鍊艰秺澶ч€熷害瓒婃參 rowheight:24 //姣忚鐨勯珮搴? }; var opts = $.extend({}, defaults, options),intid = []; function marquee(obj, step){ obj.find("ul").animate({ margintop: '-=1' },0,function(){ var s = math.abs(parseint($(this).css("margin-top"))); if(s >= step){ $(this).find("li").slice(0, 1).appendto($(this)); $(this).css("margin-top", 0); } }); } this.each(function(i){ var sh = opts["rowheight"],speed = opts["speed"],_this = $(this); intid[i] = setinterval(function(){ if(_this.find("ul").height()<=_this.height()){ clearinterval(intid[i]); }else{ marquee(_this, sh); } }, speed); _this.hover(function(){ clearinterval(intid[i]); },function(){ intid[i] = setinterval(function(){ if(_this.find("ul").height()<=_this.height()){ clearinterval(intid[i]); }else{ marquee(_this, sh); } }, speed); }); }); } })(jquery);