| 编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛
全能ASP/PHP/ASP.NET主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付买域名,送MP3、MP4
高端软件开发 = 年薪十万不是梦赛孚耐:软件保护加密专家身份认证令牌USB KEY买空间,免费送域名(厦门中资源)
共有 164 人关注过本帖
标题:asp 与 javascript 结合的问题,请大家指教一下,摆脱滚动错位的问题,谢谢了.
收藏  订阅  推荐  打印 
byters
Rank: 2
等级:注册会员
帖子:52
积分:618
注册:2008-8-11
asp 与 javascript 结合的问题,请大家指教一下,摆脱滚动错位的问题,谢谢了.

<table width="465" height="137" border="0" cellpadding="0" cellspacing="0" class="Table3">
<tr>
<td width="463" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25" bgcolor="b39c1c">

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><strong>最新商品</strong></td>
<td>更多</td>
</tr>
</table>
</td>
</tr>  

<tr>  
<td>
<div style="overflow:hidden; height:85px" id="icefable1">
<table width="463" height="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<%
sql="select top 12 * from table where len(图片字段)>1 order by id desc"
set rs=conn.execute(sql)
i=1
do while not rs.eof
%>
<td>
<!--循环体开始-->

<table width="100" height="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="upfile/<%=rs("图片字段")%>" border="0" height="75" vspace="6" class="Image1" width="100"/></td>
</tr>
<tr>
<td height="15"><%=rs("图片名称")%></td>
</tr>
</table>

<!--循环体结束-->    
</td>

<%

if i mod 4 = 0 then
response.Write("<tr>")
end if
i=i+1
rs.movenext:loop
rs.close
set rs=nothing
%>
</tr>
</table>
</div>
</td>
</tr>  
</table>



</td>
</tr>  
</table>

<script>//以下是图片循环的脚本,我想让它定时向上滚动每个层上有三张图片横向排列(读取数据库中的内容)但总是在第二遍循环后,就出现了错位的现象
//icefable1就是我想要循环的层的id,其他的不是很懂
marqueesHeight=100;
stopscroll=false;
with(icefable1){
style.width=0;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
preTop=0; currentTop=marqueesHeight; stoptime=0;
icefable1.innerHTML+=icefable1.innerHTML;


function init_srolltext(){
icefable1.scrollTop=1;
setInterval("scrollUp()",1);
}init_srolltext();

function scrollUp(){
if(stopscroll==true) return;
currentTop+=1;
if(currentTop==marqueesHeight+3)
{
stoptime+=1;
currentTop-=1;
if(stoptime==500)
{
currentTop=0;
stoptime=0;          
}
}
else {      
preTop=icefable1.scrollTop;
icefable1.scrollTop+=1;
if(preTop==icefable1.scrollTop){
icefable1.scrollTop=marqueesHeight;

icefable1.scrollTop+=1;

}
}
}
init_srolltext();
</script>
搜索更多相关主题的帖子: javascript  asp  错位  滚动  指教  
2008-8-16 08:11
关于我们 | 广告合作 | 编程中国 | 清除Cookies | Archiver | WAP | TOP

编程中国 版权所有,并保留所有权利。鲁ICP备08000592号
Powered by Discuz, Processed in 0.049885 second(s), 9 queries.
Copyright©2004-2008, BCCN.NET, All Rights Reserved