图片从下往上无间隙滚动代码

<div id=demo1>
  <a href="show.aspx?id=67&cid=21" target="_blank"><img src="image/old1.jpg" alt="" width="150" height="80" /></a>
  <a href="show.aspx?id=68&cid=21" target="_blank"><img src="image/old2.jpg" alt="" width="150" height="80" /></a>
   <a href="show.aspx?id=69&cid=21" target="_blank"><img src="image/old3.jpg" alt="" width="150" height="80" /></a>
    <a href="show.aspx?id=70&cid=21" target="_blank"><img src="image/old4.jpg" alt="" width="150" height="80" /></a>
     <a href="show.aspx?id=71&cid=21" target="_blank"><img src="image/old5.jpg" alt="" width="150" height="80" /></a>
  </div>
  <div id=demo2></div>
  <script>
   var speed=50
   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>

posted on 2012-12-19 10:55  阿良  阅读(719)  评论(0编辑  收藏  举报