竖向无缝滚动
var p_table=document.getElementById("p-table"); var noticeHTML=p_table.innerHTML; var timer=null; function move(){ clear(); var val1=p_table.scrollTop; p_table.scrollTop+=1; var val2=p_table.scrollTop; if(val1===val2){ p_table.innerHTML+=noticeHTML; } timer=window.setTimeout(move,100); } function clear(){ window.clearTimeout(timer); timer=null; } move(); p_table.onmouseover=clear; p_table.onmouseout=move;
<div class="p-table" id="p-table" style="height:568px;overflow:hidden"> <ul> <li><span>123456</span><span>123456</span><span>123456</span><span>123456</span><span>123456</span><span>123456</span></li> </ul> </div>