<head>
<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />
</head>
<body>
<div id=roll1 style="OVERFLOW:hiddenWIDTH:450px">
<table>
<tr>
<td id=rollleft1>
<table>
<tr>
<td>1111111111111111</td>
<td>2222222222222222</td>
<td>3333333333333333</td>
<td>4444444444444444</td>
</tr>
</table>
</td>
<td id=rollright1></td>
</tr>
</table>
</div>
<table>
<tr>
<td>
<SCRIPT language=JavaScript type=text/JavaScript>
var speed1=22
rollright1.innerHTML=rollleft1.innerHTML
function Marquee1(){
if(rollright1.offsetWidth-roll1.scrollLeft<=0)
roll1.scrollLeft-=rollleft1.offsetWidth
else{
roll1.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,speed1)
roll1.onmouseover=function() {clearInterval(MyMar1)}
roll1.onmouseout=function() {MyMar1=setInterval(Marquee1,speed1)}
</SCRIPT>
</td>
</tr>
</table>
</body>
</html>
<div id="demo" style="overflow:hiddenwidth:600pxcolor:#ffffff"><table cellpadding="0" cellspacing="0" border="0">
<tr><td id="demo1" valign="top" align="center">
<table cellpadding="2" cellspacing="0" border="0">
<tr align="center">
<td><img src="图片路径" width="100"></td>
<td><img src="图片路径" width="100"></td>
<td><img src="图片路径" width="100"></td>
<td><img src="图片路径" width="100"></td>
<td><img src="图片路径" width="100"></td>
</tr>
</table>
</td>
<td id="demo2" valign="top"></td>
</tr>
</table>
</div>
<script>
var speed=1//速度数值越大速度越慢
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>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)