我的无缝向左循环滚动代码在只能从第一张滚动到最后一张,不能循环提取数据库图片为什么?
<!--最新图文代码开始--><%ConstNew_img=10setrs_Product=server.createobject("adodb.recordset")s...
<!--最新图文代码开始-->
<%
Const New_img=10
set rs_Product=server.createobject("adodb.recordset")
sqltext="select top " & New_img & " * from Product where Passed=True order by UpdateTime desc"
rs_Product.open sqltext,conn,1,1
if not rs_Product.EOF then%>
<div align='center' id='demo' style='overflow:hidden;height:145px;width:600px;'><!--滚动区的高度和宽度-->
<table border='0' align='center' cellpadding='0' cellspacing="0" cellspace='0'>
<tr>
<td id='demo1' valign='top'>
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>
<tr valign='top'>
<%
while not rs_Product.EOF
fileExt=lcase(getFileExtName(rs_Product("DefaultPicUrl")))
%>
<td align='center'>
<TABLE width=100% border=0 align=center cellPadding=0 cellSpacing=0>
<TR>
<TD> </TD>
<TD align="center" width="143" height="110" style="border:#ccc 1px solid;">
<a href='ProductShow.asp?ID=<%=rs_Product("ID")%>' target=_blank title='<%=rs_Product("title")%>'>
<img border="0" src="<%if rs_Product("DefaultPicUrl")="" then%>Img/nopic.gif<%else%><%=rs_Product("DefaultPicUrl")%><%end if%>" alt="<%=rs_Product("title")%>" width=133 height=100></a></TD>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
<TD align=center height=20>
<a href='ProductShow.asp?ID=<%=rs_Product("ID")%>' target=_blank title='<%=rs_Product("title")%>'><%=rs_Product("title")%></a>
</TD>
<TD> </TD>
</TR>
</TABLE>
</td>
<%
rs_Product.MoveNext
wend
%>
</tr>
</table>
</td>
<td id=demo2 valign=top></td>
</tr>
</table>
</div>
<%if New_img >5 then%>
<script>
var Picspeed=15
demo2.innerHTML=demo1.innerHTML
function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,Picspeed)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {MyMar1=setInterval(Marquee1,Picspeed)}
</script>
<%end if
else
Response.Write "暂无最新图文"
end if
rs_Product.close
set rs_Product=nothing
%>
<!--最新图文代码结束--> 展开
<%
Const New_img=10
set rs_Product=server.createobject("adodb.recordset")
sqltext="select top " & New_img & " * from Product where Passed=True order by UpdateTime desc"
rs_Product.open sqltext,conn,1,1
if not rs_Product.EOF then%>
<div align='center' id='demo' style='overflow:hidden;height:145px;width:600px;'><!--滚动区的高度和宽度-->
<table border='0' align='center' cellpadding='0' cellspacing="0" cellspace='0'>
<tr>
<td id='demo1' valign='top'>
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>
<tr valign='top'>
<%
while not rs_Product.EOF
fileExt=lcase(getFileExtName(rs_Product("DefaultPicUrl")))
%>
<td align='center'>
<TABLE width=100% border=0 align=center cellPadding=0 cellSpacing=0>
<TR>
<TD> </TD>
<TD align="center" width="143" height="110" style="border:#ccc 1px solid;">
<a href='ProductShow.asp?ID=<%=rs_Product("ID")%>' target=_blank title='<%=rs_Product("title")%>'>
<img border="0" src="<%if rs_Product("DefaultPicUrl")="" then%>Img/nopic.gif<%else%><%=rs_Product("DefaultPicUrl")%><%end if%>" alt="<%=rs_Product("title")%>" width=133 height=100></a></TD>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
<TD align=center height=20>
<a href='ProductShow.asp?ID=<%=rs_Product("ID")%>' target=_blank title='<%=rs_Product("title")%>'><%=rs_Product("title")%></a>
</TD>
<TD> </TD>
</TR>
</TABLE>
</td>
<%
rs_Product.MoveNext
wend
%>
</tr>
</table>
</td>
<td id=demo2 valign=top></td>
</tr>
</table>
</div>
<%if New_img >5 then%>
<script>
var Picspeed=15
demo2.innerHTML=demo1.innerHTML
function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,Picspeed)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {MyMar1=setInterval(Marquee1,Picspeed)}
</script>
<%end if
else
Response.Write "暂无最新图文"
end if
rs_Product.close
set rs_Product=nothing
%>
<!--最新图文代码结束--> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询