无限轮播代码

2016-12-08  本文已影响15人  老白儿
function slideMove(){
    var speed=30;
    var slide=document.getElementById("slide");
    var slide2=document.getElementById("slide2");
    var slide1=document.getElementById("slide1");
    var slideHeight = slide1.clientHeight;
    
    if(slideHeight > slide.clientHeight){
        slide2.innerHTML=slide1.innerHTML;
        var _scroll_top = 0;
       setInterval(Marquee,speed);
    }

    function Marquee(){
        _scroll_top ++;
        if(_scroll_top > slideHeight){
            _scroll_top = 0;
        }
         slide.scrollTop = _scroll_top;
    }
}
上一篇下一篇

猜你喜欢

热点阅读