[此贴子已经被作者于2007-5-21 13:58:12编辑过]
[此贴子已经被作者于2007-5-21 13:58:12编辑过]
我这有个无限滚动的效果 给你看下吧
<td bgcolor="#A8E4DC">
<div id=demo style="overflow:hidden;height:87;width:680;color:#ffffff">
<table width=712 border=0 cellpadding=0 cellspacing=0>
<tr>
<td>
<table align=left cellpadding=0 cellspace=0 border=0>
<tr>
<td id=demo1 valign=top>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<%
sql="select * from prod where tj=true order by id desc"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
else
%>
<% i=1
do while i<20
%>
<td>
<a href=product.asp?id=<%=rs("id")%> title="<%=rs("title")%>"><img src="admin/<%=rs("photo")%>" width="100" height="87" border="0" class=b1 hspace=22></a>
</td>
<%
i=i+1
rs.movenext
if rs.eof or rs.bof then rs.movefirst
loop
end if%>
</tr>
</table>
</td>
<td id=demo2 valign=top></td>
</tr>
</table>
<script>
var speed=10//速度数值越大速度越慢
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>
</td>
</tr>
</table>
</div>
</td>