文本滚动 文字滚动 垂直 滚动

HTML:
<ul> <li style="background:red">1,所发生的方式111的</li> <li>2,所发生的方式的</li> <li>3,所发生的方式的</li> <li>4,所发生的方式的</li> <li>5,所发生的方式的</li> </ul>
JS:
var li_num=$('ul li').length; var set_num=4;//信息小于或者等于4条就不会滚动 function run(){ $('ul li:first').animate({opacity:'0'},800,function (){ $(this).css({opacity:'1'}).appendTo($('ul')); run(); }); }; if(li_num<=set_num){ $('ul li').stop(true,true).stop(); }else{ run() } $('ul').mouseenter(function(){ $('ul li').stop(true,true).stop(); }).mouseleave(function(){ if(li_num<=set_num){ $('ul li').stop(true,true).stop(); }else{ run() } });