function autoRoll_UpDown($domObj,speed){ var speed = speed || 3000; //默认速度3秒 var len = $domObj.children().length; var chiH = $domObj.children().height(); if(len>1){ $domObj.append($domObj.html()); var pointRoll = 0; function move(){ pointRoll++; if(pointRoll > len){ pointRoll = 1; $domObj.css(‘top‘,‘0px‘); } $domObj.animate({top:-chiH*pointRoll+"px"}); } var time = setInterval(move,speed) $domObj.hover(function(){ clearInterval(time); },function(){ time = setInterval(move,speed) })