图片移动问题
大家好,我有这样一个问题。我打算在一个表格里读取N个图片,然后在移动,但是可以显示,就是不会动,恳请大家帮忙看看,是哪个位置错了。谢谢代码如下:
<table width="820" height="132" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#66CC66" bgcolor="#FFFFFF">
<tr>
<td width="820" align="center">
<DIV id=div_photo style="OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff; HEIGHT: 125px">
<DIV id=div_photo1>
<%set rs=server.createobject("adodb.recordset")
rs.open "select top 14 username,sex,photo_x,photo_d,photo_x_flag,photo_d_flag,flag from love_main where ((photo_x_flag=1 and photo_x<>'') or (photo_d_flag=1 and photo_d<>''))and flag<>0 order by refresh_time desc,id desc",conn,1,1
IF (rs.State =adStateClosed) or (rs.BOF=true and rs.EOF =true) or rs.RecordCount=0 THEN
RESPONSE.Write"<table><tr><td><BR><BR> 暂无照片,[<a href=u_mod.asp?submitok=five>立即上传</a>]"
else
n= 1
m= 7
do while not rs.eof
%>
<table width="110" border="0" align="left" cellpadding="3" cellspacing="0" >
<tr align="center"> </tr>
<tr>
<td width="110" align="center" style="color:#666666;"><table width="80" height="62" border="0" cellpadding="0" cellspacing="1" bgcolor="cccccc" style="border-right:#efefef 2px solid;border-bottom:#efefef 2px solid;">
<tr>
<td align="center" bgcolor="#FFFFFF" style="color:#000000;"><%
If rs("photo_x_flag")=1 and rs("photo_d_flag")=1 Then'大小都有
response.write "<a href=photo/"&rs("photo_d")&" target=_blank><img src=UpLoadPhoto/"&rs("photo_x")&" width=100 height=75 border=0 hspace=4 vspace=4 alt=网名:"&rs("username")&"></a>"
ElseIf rs("photo_x_flag")=1 and (rs("photo_d_flag")=0 or rs("photo_d_flag")="") Then'有小无大
response.write "<a href=photo/"&rs("photo_x")&" target=_blank><img src=UpLoadPhoto/"&rs("photo_x")&" width=100 height=75 border=0 hspace=4 vspace=4 alt=网名:"&rs("username")&"></a>"
ElseIf rs("photo_d_flag")=1 and (rs("photo_x_flag")=0 or rs("photo_x_flag")="") Then'有大无小
response.write "<a href=photo/"&rs("photo_d")&" target=_blank><img src=UpLoadPhoto/"&rs("photo_d")&" width=100 height=75 border=0 hspace=4 vspace=4 alt=网名:"&rs("username")&"></a>"
End If
%></td>
</tr>
</table>
<img src="images/hehe.gif" width="100" height="4"><br>
<a href="display.asp?username=<%=rs("username")%>" target="_blank"><img src="images/a.gif" width="16" height="16" hspace="2" border="0" alt=查看个人资料></a>
<%
If rs("photo_x_flag")=1 and rs("photo_d_flag")=1 Then'大小都有
response.write "<a href=photo/"&rs("photo_d")&" target=_blank><img src=images/e.gif width=16 height=16 hspace=2 border=0 alt=查看形象照片></a>"
ElseIf rs("photo_x_flag")=1 and (rs("photo_d_flag")=0 or rs("photo_d_flag")="") Then'有小无大
response.write "<a href=photo/"&rs("photo_x")&" target=_blank><img src=images/e.gif width=16 height=16 hspace=2 border=0 alt=查看形象照片>"
ElseIf rs("photo_d_flag")=1 and (rs("photo_x_flag")=0 or rs("photo_x_flag")="") Then'有大无小
response.write "<a href=photo/"&rs("photo_d")&" target=_blank><img src=images/e.gif width=16 height=16 hspace=2 border=0 alt=查看形象照片></a>"
End If
%>
<a href="dis_gbook.asp?username=<%=rs("username")%>" target="_blank"><img src="images/b.gif" width="16" height="16" hspace="2" border="0" alt="给他(她)留言"></a><a href="friend_hmd.asp?username=<%=rs("username")%>&submitok=friend" target="_blank"><img src="images/c.gif" width="16" height="16" hspace="2" border="0" alt=加为好友></a></td>
<%
If n = m then
Response.Write("</tr><tr>")
n = 1
Else
n = n + 1
End If
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
</tr>
</table>
</DIV>
<DIV id=div_photo2></DIV>
</DIV></td>
<SCRIPT>
var speed_photo=10
var Myphoto
div_photo2.innerHTML=div_photo1.innerHTML
f_photo();
function f_photo()
{
Myphoto=setInterval(Marquee_photo,speed_photo)
}
function Marquee_photo(){
if ((div_photo.scrollTop%133)==0)
{
window.clearInterval(Myphoto);
window.setTimeout("f_photo()", 3000);
}
if(div_photo2.offsetTop-div_photo.scrollTop<=0)
div_photo.scrollTop-=div_photo1.offsetHeight;
else{
div_photo.scrollTop++
}
}
</SCRIPT>
</tr>
</table>