有没有比较简单容易实现的代码啊?
我有一个。
<div id=demo style=overflow:hidden;height:226px>
<div id="demo1">
<li><img src="img.gif" height="226" width="140"></li>
<li><img src="img.gif" height="226" width="140"></li>
<li><img src="img.gif" height="226" width="140"></li>
<li><img src="img.gif" height="226" width="140"></li>
<li><img src="img.gif" height="226" width="140"></li>
</div>
<div id="demo2"></div>
</div>
<script language="javascript">
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight
else{
demo.scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
</div>
有了!
<DIV id=demo
style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; OVERFLOW: hidden;WIDTH:360px; HEIGHT:170px; BORDER-BOTTOM: 0px" align="center">
<TABLE cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR>
<TD id=demo1>
<table width="379">
<tr><td width="100">
<img src="read/read_clip_image002.jpg" width="85" height="120"> </td>
<td width="100"> <img src="read/read_clip_image002_0000.jpg" width="85" height="120"></td>
<td width="100"><img src="read/read_clip_image002_0001.jpg" width="85" height="120"></td>
<td width="100"><img src="read/read_clip_image002_0002.jpg" width="85" height="120"></td>
<td width="100"><img src="read/read_clip_image002_0003.jpg" width="85" height="120"></td>
<td width="100"><img src="read/read_clip_image002_0004.jpg" width="85" height="120"></td>
</tr>
<tr><td align="center"><a href="html/read.asp?act=tu1">西点的10堂领导课</a></td>
<td align="center"><a href="html/read.asp?act=tu2">恰同学少年</a></td>
<td align="center"><a href="html/read.asp?act=tu3">天堂镇</a></td>
<Td align="center"><a href="html/read.asp?act=tu4">感谢折磨你的人全集</a></Td>
<td align="center"><a href="html/read.asp?act=tu5">财富故事会——征文</a></td>
<td align="center"><a href="html/read.asp?act=tu6">网络管理员超级技巧</a></td>
</tr></table>
</TD>
<TD id=demo2 width=1></TD></TR></TBODY></TABLE></DIV>
<SCRIPT>
var speed=40//速度数值越大速度越慢
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>
修改图片的路径就行了,里面的table可以任意更改