| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 856 人关注过本帖
标题:[求助] 如何读取数据库的图片,并从右向左移动?
取消只看楼主 加入收藏
porsun
Rank: 1
等 级:新手上路
帖 子:48
专家分:0
注 册:2011-7-4
结帖率:50%
收藏
已结贴  问题点数:20 回复次数:3 
[求助] 如何读取数据库的图片,并从右向左移动?
大家好,我在学习《水样月光交友程序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>

搜索更多相关主题的帖子: 图片 
2011-07-04 23:54
porsun
Rank: 1
等 级:新手上路
帖 子:48
专家分:0
注 册:2011-7-4
收藏
得分:0 
哎呀,没人帮忙吗? 快帮帮我吧~
2011-07-05 22:38
porsun
Rank: 1
等 级:新手上路
帖 子:48
专家分:0
注 册:2011-7-4
收藏
得分:0 
各位高手,帮帮忙吧 帮帮忙吧 帮帮忙吧
2011-07-06 11:14
porsun
Rank: 1
等 级:新手上路
帖 子:48
专家分:0
注 册:2011-7-4
收藏
得分:0 
这样似乎更复杂了哦,上面这个代码的功能是这样,读取最新16位会员图片,然后分成2行,每行8位。然后循环向上移动。

我的想法是:改成取10位,一行展示完毕,从右向左移动。

但是我怎么改,图片都不动的,死在那里,唉~
2011-07-07 00:04
快速回复:[求助] 如何读取数据库的图片,并从右向左移动?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018748 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved