| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 663 人关注过本帖
标题:asp 与 javascript 结合的问题,请大家指教一下,摆脱滚动错位的问题,谢谢了.
只看楼主 加入收藏
byters
Rank: 1
等 级:新手上路
帖 子:80
专家分:0
注 册:2008-8-11
结帖率:100%
收藏
 问题点数:0 回复次数:0 
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-08-16 08:11
快速回复:asp 与 javascript 结合的问题,请大家指教一下,摆脱滚动错位的问题,谢 ...
数据加载中...
 
   



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

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