191、图片上下无间断滚动

191、图片上下无间断滚动

</p>

<div id=demo style=overflow:hidden;height:300;width:150>

       <div id=demo1>

              <img src='roll/1.png'><br>

              <img src='roll/2.png'><br>

              <img src='roll/3.png'><br>

              <img src='roll/4.png'><br>

              <img src='roll/5.png'><br>

              <img src='roll/6.png'><br>

              <img src='roll/7.png'><br>

              <img src='roll/8.png'><br>

              <img src='roll/3.png'><br>

              <img src='roll/4.png'><br>

              <img src='roll/5.png'><br>

              <img src='roll/6.png'><br>

              <img src='roll/7.png'><br>

              <img src='roll/8.png'><br>

              <img src='roll/2.png'><br>

       </div>

       <div id=demo2></div>

</div>

<p>

  <script>

var speed=30;

demo2.innerHTML=demo1.innerHTML

function Marquee()

{

       if(demo2.offsetTop-demo.scrollTop<=0)

              demo.scrollTop-=demo1.offsetHeight;

       else

              demo.scrollTop++;

}

var MyMar=setInterval(Marquee,speed)

demo.onmouseover=function() {clearInterval(MyMar)}

demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}

</script>

</p>

Write a comment

Comments: 0