<div id=demo style=overflow:hidden;height:100;width:570;background:#ffffff;color:#ffffff>
<table align=left cellpadding=0 cellspace=0 border=0>
<tr>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from product where tj=1"
rs.open sql,conn,1,1
do while not rs.eof
%><td id=demo1 valign=top><img src="../<%=rs("p_pic")%>" width="100" height="100" border="0">
</td>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
<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>
代码在上面,这个可以实现图片横向滚动,但是就是不连续,滚过去一张就回到第一张,请教