竖向无缝滚动

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>

 

posted @ 2016-08-08 16:54  dongxiaolei  阅读(285)  评论(0编辑  收藏  举报