网上很多,看他们的源码啊
[QUOTE]<div id="demo" style="overflow:hidden;width:620px">
<table cellspacing="0" cellpadding="0"><tr>
<td id=demo1>
<table width="852" cellspacing="0" cellpadding="0">
<tr>
<td><img src="a/a.jpg" width="140" height="105" style="border:1 solid #FFF77F"></td>
</tr></table>
</td>
<td id=demo2></td></tr></table></div>
<script>
var speed=15//速度数值越大速度越慢
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
要求:bemo1的表格长度要大于DIV的长度.[/QUOTE]
反向运动
[QUOTE]if(news.scrollLeft<=0){
news.scrollLeft+=news2.offsetWidth
}
else{
news.scrollLeft--[/QUOTE]