参考:
http://topic.csdn.net/u/20071128/08/f6091095-3d88-4c56-8608-1a6ca1566cf6.html9)dhScroll系列,几种无缝滚动的实现;
http://topic.csdn.net/u/20071128/08/f6091095-3d88-4c56-8608-1a6ca1566cf6.html9)dhScroll系列,几种无缝滚动的实现;
调试欢乐多
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body>
<div id=demo style="overflow:hidden; height:130px; width:300px;">
<table align=left cellpadding=0 cellspacing=0 border=0 style="width: 1800px;">
<tr>
<td id=demo1 valign=top>
<img src="http://www.google.cn/logos/earthday05.gif">
<img src="http://www.google.cn/logos/da_vinci.gif">
<img src="http://www.google.cn/logos/intl_women.gif">
<img src="http://www.google.cn/logos/valentine05.gif">
<img src="http://www.google.cn/logos/newyear05.gif">
<img src="http://www.google.cn/logos/water_day05.gif">
</td>
<td id=demo2 valign=top></td>
</tr>
</table>
</div>
<script> var speed = 30;
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>
</body>
</html>