var speed = 30; //数字越大速度越慢

function ScrollTopStart(divf, divs, dive) {
    var tab = document.getElementById(divf);
    var tab1 = document.getElementById(divs);
    var tab2 = document.getElementById(dive);

    tab2.innerHTML = tab1.innerHTML; //克隆demo1为demo2
    var Marquee = function () {
        if (tab.scrollTop >= tab1.offsetHeight) {//当滚动至demo1与demo2交界时            
            tab.scrollTop -= tab1.offsetHeight; //demo跳到最顶端
        } else 
            tab.scrollTop++;        
    };

    var MyMar = setInterval(Marquee, speed);
    tab.onmouseover = function () { clearInterval(MyMar) };//鼠标移上时清除定时器达到滚动停止的目的
    tab.onmouseout = function () { MyMar = setInterval(Marquee, speed) };//鼠标移开时重设定时器
}