其中的-3是為了彌補IE下抖一下的問題
在火狐下是-7
<style type="text/CSS">
<!--
#demo {
overflow:hidden;
border: 1px dashed #CCC;
width: 400px;
height:100px;
}
#indemo {
float: left;
width:5000%;
}
-->
</style>
<div id="demo">
<div id="indemo">
<span id="demo1">
<img src="" /><img src="" /><img src="" /><img src="" /><img src="" /><img src="" /></span>
<span id="demo2"></span>
</div>
</div>
<script>
<!--
var speed=10;
demo2.innerHTML=demo1.innerHtml;
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft == -3)
demo.scrollLeft = 0;
else{
demo.scrollLeft++;
}
}
var MyMar=setInterval(Marquee,speed);
demo.onmouSEOver=function() {clearInterval(MyMar)};
demo.onmouSEOut=function() {MyMar=setInterval(Marquee,speed)};
-->
</script>