找了好長時間,終於找到一個合適的了,根據需要改改寬度和圖像個數就可以了,用循環動態調用數據庫代碼就OK了
圖片滾動
<script> <BR><!- - <BR>var speed=10; <BR>var tab=document.getElementById("demo"); <BR>var tab1=document.getElementById("demo1"); <BR>var tab2=document.getElementById(" demo2"); <BR>tab2.innerHTML=tab1.innerHTML; <BR>function Marquee(){ <BR>if(tab2.offsetWidth-tab.scrollLeft<=0) <BR>tab.scrollLeft-=tab1.setWidth <BR>else{ <BR>tab.scrollLeft ; <BR>} <BR>} <BR>var MyMar=setInterval(Marquee,speed); <BR>tab.onmouseover=function() {clearInterval(Mar)}; <BR>tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)}; <BR>--> <BR></script>