[求助] 如何读取数据库的图片,并从右向左移动?
大家好,我在学习《水样月光交友程序2010》,我想把首页的图片显示方式改成 从右向左移动,但是参考了很多网上的代码,都改不成功,恳请大家帮助一下,谢谢!我希望的效果:读取最新的10张图片,单行显示,向左移动。
===========================================================
原代码如下(它是显示为两行,交替向上移动)
<tr>
<td align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="35" align="center"><img src="images/1.gif" width="31" height="22" /></td>
<td>最新加入的男会员推荐</td>
</tr>
</table></td>
</tr>
<tr>
<td height="15" align="center"><img src="images/5.gif" width="700" height="2" /></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><DIV id=div_tt style="BACKGROUND: #ffffff; OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff; HEIGHT: 125px">
<DIV id=div_tt1>
<table width="90" height="120" border="0" cellpadding="0" cellspacing="0">
<tr>
<%
dim usex0
usex0="男性"
set rs = server.CreateObject("adodb.recordset")
sql="select TOP 16 u_id,u_cuname,u_photo from f_user where u_sub=1 and u_sex='"&usex0&"'and u_photo<>'' Order BY u_id desc"
rs.open sql,conn,1,1
if rs.eof or rs.bof then
response.write "<div align='center'>暂无推荐!</div>"
else
n1= 1
m1= 8
do while not rs.eof
%>
<td height="120" align="center"><table width="90" height="120" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="98" align="center" valign="top"><TABLE border=0
align=center cellPadding=0 cellSpacing=1 bgColor=#cccccc>
<TBODY>
<TR>
<TD align=middle bgColor=#ffffff><a href="user_info.asp?uid=<%=rs("u_id")%>" target="_blank"><img src="userphoto/<%=rs("u_photo")%>" width="80" height="105" border="0" style="border-color:#FF0000" align="absmiddle"></a></TD>
</TR>
</TBODY>
</TABLE></td>
</tr>
<tr>
<td height="23" align="center"><a href="user_info.asp?uid=<%=rs("u_id")%>" target="_blank">
<%
a1=rs("u_cuname")
if len(a1)>10 then
a1 = left(a1,10)&".."
end if
response.write ""&a1&""
%>
</a></td>
</tr>
</table></td>
<%
If n1 = m1 then
Response.Write("</tr><tr>")
n1 = 1
Else
n1 = n1 + 1
End If
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
</tr>
</table>
</DIV>
<DIV id=div_tt2></DIV>
</DIV></TD>
<SCRIPT>
var speed_tt=7
var Mytt
div_tt2.innerHTML=div_tt1.innerHTML
f_tt();
function f_tt()
{
Mytt=setInterval(Marquee_tt,speed_tt)
}
function Marquee_tt(){
if ((div_tt.scrollTop%133)==0)
{
window.clearInterval(Mytt);
window.setTimeout("f_tt()", 3000);
}
if(div_tt2.offsetTop-div_tt.scrollTop<=0)
div_tt.scrollTop-=div_tt1.offsetHeight;
else{
div_tt.scrollTop++
}
}
</SCRIPT>
</tr>
</table></td>
</tr>