| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 576 人关注过本帖
标题:图片移动问题
只看楼主 加入收藏
porsun
Rank: 1
等 级:新手上路
帖 子:48
专家分:0
注 册:2011-7-4
结帖率:50%
收藏
已结贴  问题点数:0 回复次数:5 
图片移动问题
大家好,我有这样一个问题。我打算在一个表格里读取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>
搜索更多相关主题的帖子: 图片 移动 ffffff border center 
2011-08-11 00:25
porsun
Rank: 1
等 级:新手上路
帖 子:48
专家分:0
注 册:2011-7-4
收藏
得分:0 
没人会吗? 帮帮忙啦。。
2011-08-11 16:57
porsun
Rank: 1
等 级:新手上路
帖 子:48
专家分:0
注 册:2011-7-4
收藏
得分:0 
啊?还没人帮忙啊,惨咯。。等着上线的呢

版主,救救我吧
2011-08-12 13:16
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:10 
这个属于js错误,lz需要查看一下运行后的浏览器代码
2011-08-12 13:44
nothing_fly
Rank: 2
等 级:论坛游民
帖 子:18
专家分:43
注 册:2011-8-14
收藏
得分:10 
这不属于ASP问题啊... 呵呵
2011-08-14 02:55
porsun
Rank: 1
等 级:新手上路
帖 子:48
专家分:0
注 册:2011-7-4
收藏
得分:0 
我已经多次测试解决,谢谢大家!

现在共享成功后的源码!!


<table width="820" height="122" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCFFCC" bgcolor="#FFFFFF">
    <tr>
    <td width="820" align="center" class="bg_5" style="border:2px solid #ffffff">
    <DIV id=div_photo style="OVERFLOW: hidden; WIDTH: 820px; COLOR: #ffffff; HEIGHT: 110px">
    <table width="100%"><tr><td id=div_photo1>
    <%set rs=server.createobject("adodb.recordset")
rs.open "select top 16 id,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= 8
do while not rs.eof
%>
<table width="96" border="0" align="left" cellpadding="3" cellspacing="0" >
       <tr align="center"> </tr>
       <tr>
         <td width="96" align="center" style="color:#666666;"><table width="80" height="65" 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=UpLoadPhoto/"&rs("photo_d")&" target=_blank><img src=UpLoadPhoto/"&rs("photo_x")&" width=80 height=65 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=UpLoadPhoto/"&rs("photo_x")&" target=_blank><img src=UpLoadPhoto/"&rs("photo_x")&" width=80 height=65 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=UpLoadPhoto/"&rs("photo_d")&" target=_blank><img src=UpLoadPhoto/"&rs("photo_d")&" width=80 height=65 border=0 hspace=4 vspace=4 alt="&rs("username")&"></a>"
End If
%></a></td>
             </tr>
           </table>
             <img src="images/hehe.gif" width="96" height="4"><br>
             <a href="Display.asp?MemberID=<%=rs("id")%>" target="_blank"><img src="images/a.gif" width="15" height="15" hspace="2" border="0" alt=个人资料></a>
             <%
If rs("photo_x_flag")=1 and rs("photo_d_flag")=1 Then'大小都有
     response.write "<a href=UpLoadPhoto/"&rs("photo_d")&" target=_blank><img src=images/e.gif  width=15 height=15 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=UpLoadPhoto/"&rs("photo_x")&" target=_blank><img src=images/e.gif  width=15 height=15 hspace=2 border=0 alt=形象照片></a>"
ElseIf rs("photo_d_flag")=1 and (rs("photo_x_flag")=0 or rs("photo_x_flag")="") Then'有大无小
     response.write "<a href=UpLoadPhoto/"&rs("photo_d")&" target=_blank><img src=images/e.gif  width=15 height=15 hspace=2 border=0 alt=形象照片></a>"
End If
%>
           <a href="GbookSend.asp?RequestUserName=<%=rs("username")%>&MemberID=<%=rs("id")%>" target="_blank"><img src="images/b.gif" width="16" height="16" hspace="2" border="0" alt="给他TA留言"></a> <a href="friend_hmd.asp?UserName=<%=rs("username")%>&MemberID=<%=rs("id")%>&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>
     </td></tr><tr><td id=div_photo2></td></tr></table>
    </DIV>

 <script>
var speedddyh=20
div_photo2.innerHTML=div_photo1.innerHTML//克隆demo1为demo2
function Marqueeddyh(){
if(div_photo2.offsetHeight-div_photo.scrollTop<=0)//当滚动至demo1与demo2交界时
div_photo.scrollTop-=div_photo1.offsetHeight//demo跳到最顶端
else{
div_photo.scrollTop++
}
}
var MyMarddyh=setInterval(Marqueeddyh,speedddyh)//设置定时器
div_photo.onmouseover=function() {clearInterval(MyMarddyh)}//鼠标移上时清除定时器达到滚动停止的目的
div_photo.onmouseout=function() {MyMarddyh=setInterval(Marqueeddyh,speedddyh)}//鼠标移开时重设定时器
</script>
 </td>
  </tr>
</table>
2011-08-17 11:10
快速回复:图片移动问题
数据加载中...
 
   



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

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