请高手指点,下面这部分代码,是循环向上滚动显示图片,以每行五个图片,现在只循环一次就不向上滚动了
<tablewidth="960"border="0"align="center"cellpadding="0"cellspacing="0"background="im...
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0" background="images/guanggao.jpg">
<tr>
<td width="960" height="113" align="right" style="padding-right:15px;">
<%
set rs_Product=server.createobject("adodb.recordset")
sqlt="select * from gun order by addtime desc"
rs_Product.open sqlt,conn,1,1
%>
<div align='center' id='demo' style='overflow:hidden;height:70px;width:900px;'>
<table border='0' align='center' cellpadding='0' cellspacing="0" cellspace='0'>
<tbody>
<tr>
<td valign='top' id='demo1'><table border='0' align='center' cellpadding='0' cellspacing='0'>
<tr valign='top'>
<%row_count=1 %>
<%
do while not rs_Product.EOF
%>
<td align='right' valign="top"><img border="0" height="72" src="../picture/<%=rs_Product("imagepath")%>" width="168"></td>
<td> </td>
<%if row_count mod 5 <>0 then%>
<%end if%>
<% if row_count mod 5 =0 then%>
</tr>
<tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<%end if%>
<%
rs_Product.MoveNext
row_count=row_count+1
loop
if rs_product.eof then
row_count=1
rs_Product.MoveFirst
end if
%>
</tr>
</table></TD><TD id=demo2 vAlign=top></TD></TR></TBODY></TABLE></DIV>
<SCRIPT>
var speed=1
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></td>
</tr></table> 展开
<tr>
<td width="960" height="113" align="right" style="padding-right:15px;">
<%
set rs_Product=server.createobject("adodb.recordset")
sqlt="select * from gun order by addtime desc"
rs_Product.open sqlt,conn,1,1
%>
<div align='center' id='demo' style='overflow:hidden;height:70px;width:900px;'>
<table border='0' align='center' cellpadding='0' cellspacing="0" cellspace='0'>
<tbody>
<tr>
<td valign='top' id='demo1'><table border='0' align='center' cellpadding='0' cellspacing='0'>
<tr valign='top'>
<%row_count=1 %>
<%
do while not rs_Product.EOF
%>
<td align='right' valign="top"><img border="0" height="72" src="../picture/<%=rs_Product("imagepath")%>" width="168"></td>
<td> </td>
<%if row_count mod 5 <>0 then%>
<%end if%>
<% if row_count mod 5 =0 then%>
</tr>
<tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<%end if%>
<%
rs_Product.MoveNext
row_count=row_count+1
loop
if rs_product.eof then
row_count=1
rs_Product.MoveFirst
end if
%>
</tr>
</table></TD><TD id=demo2 vAlign=top></TD></TR></TBODY></TABLE></DIV>
<SCRIPT>
var speed=1
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></td>
</tr></table> 展开
1个回答
2011-06-25
展开全部
这里有一个无缝滚动效果
方向可以自己设置
可以设置定高定宽停顿
你把文字改成图片就行
里面有源码可以参考
方向可以自己设置
可以设置定高定宽停顿
你把文字改成图片就行
里面有源码可以参考
参考资料: http://www.blueidea.com/common/shoutbox/redir.asp?4=y&id=12229
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询