asp图片水平滚动问题,滚动一次就停了,把循环语句换成具体路径的图片就能无限滚动

luckystar_t 2011-07-27 09:01:41
<!--#include file="FiveInc/Inc.asp"-->
<%
set rs=server.createobject("adodb.recordset")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>

<link href="css/ctm.css" rel="stylesheet" type="text/css" />
</head>

<body>
<DIV id=aaa style="OVERFLOW: hidden; WIDTH: 897px; ">
<table width="897" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/Foot_hz_top.gif" height="6"></td>
</tr>
<tr>
<td background="images/Foot_hz_bg.gif" height="65" id=aaa1 >

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18">
</td>
<%
sql="select * from Links where 1=1"
sql=sql & " order by id"
rs.Open sql,conn,1,1
%>
<%
If rs.EOF AND rs.BOF then
ShowError("该栏目尚未添加合作伙伴!")
Set rs = Nothing
conn.Close
Set conn = Nothing
end if
For i = 1 To rs.RecordCount
%>

<td><img width="118" height="41" src="<%=rs("SitePic")%>"></td><td width="2"></td>
<%
rs.movenext
Next
rs.close
%>
<td width="18">
</tr>
</table>

</td> <td id=aaa2 vAlign=top width=1></td>


</TD>
</tr>
<tr>
<td background="images/Foot_hz_Foot.gif" height="9"></td>
</tr>
</table></DIV>
<script language="JavaScript" type="text/javascript">
var speed1=15
aaa2.innerHTML=aaa1.innerHTML
function Marquee(){
if (aaa2.offsetWidth-aaa.scrollLeft<=0) aaa.scrollLeft-=aaa.offsetWidth
else{ aaa.scrollLeft++ }
}
var MyMrr=setInterval(Marquee,speed1)
aaa.onmouseover=function() {clearInterval(MyMrr)}
aaa.onmouseout=function() {MyMrr=setInterval(Marquee,speed1)}
</script>
</BODY></HTML>
把循环语句换成具体路径的图片就能无限滚动,求助啊
...全文
97 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
APM60- 2011-07-27
  • 打赏
  • 举报
回复
试试
<DIV id=aaa style="OVERFLOW: hidden; WIDTH: 897px; ">
<table width="1800"
SauntErSos 2011-07-27
  • 打赏
  • 举报
回复
经过测试,如果循环系数少于8的话就只能滚动1次,而不无限滚动,主要原因是DIV长度问题,图片过少无法撑开DIV,导致JS不能循环
<DIV id=aaa style="OVERFLOW: hidden; WIDTH: 897px; ">
你可以试着改小width的值看看

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧