DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> 關於JavaScript >> javascript實現文字圖片上下滾動的具體實例
javascript實現文字圖片上下滾動的具體實例
編輯:關於JavaScript     
復制代碼 代碼如下:
<div style="border:#d3d3d3 1px solid;width:100%;">
         <div id="demo" style="overflow:hidden;height:160;width:100%;">
          <div id="demo1">
           文章標題列表
          </div>
          <div id="demo2"></div>
         </div>
        </div>
        <script language="javascript">
         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>
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved