读取SQL数据库信息并逐条向上滚动公告显示 我想显示前十条后循环 现在我实现了一条 其他的不知怎样搞
我想显示前十条后循环现在我实现了一条其他的不知怎样搞,以下是代码,高手帮我看下,感谢~<divid="wrap"style="height:27px;overflow:h...
我想显示前十条后循环 现在我实现了一条 其他的不知怎样搞,以下是代码,高手帮我看下,感谢~
<div id="wrap" style="height:27px; overflow:hidden;" >
<!--#include file="conn.asp"-->
<%
set rs = Server.CreateObject("ADODB.RecordSet")
sql = "select * from buy_fs where wincost<>'0' "&ptype&" "&tj&" "&expect1&" "&addtime1&" order by addtime desc"
rs.open sql,conn,1
%>
<ul id="box1">
<li><%=rs("username")%>|<%=protype%>|<%=rs("expect")%>|<%=rs("onemoney")%>|<%=rs("wincost")%>|<%=mid(rs("addtime"),3,len(rs("addtime"))-5)%></li>
</ul>
<ul id="box2">
</ul>
</div>
<!-- -->
<div id="cc"> </div>
<script type="text/javascript">
var $$=function(id){return document.getElementById(id);}
var start;
$$('box2').innerHTML=$$('box1').innerHTML;
function roll(){
wrap.scrollTop++;
$$('cc').innerHTML=wrap.scrollTop;
if($$('box1').offsetHeight-wrap.scrollTop>0){
if(wrap.scrollTop%wrap.offsetHeight!=0)
{
return(setTimeout(roll,20));
}
else{
return(setTimeout(roll,2000));
}
}
else{
setTimeout("$$('wrap').scrollTop=0;roll()",2000);
}
}
setTimeout(roll,2000)
</script> 展开
<div id="wrap" style="height:27px; overflow:hidden;" >
<!--#include file="conn.asp"-->
<%
set rs = Server.CreateObject("ADODB.RecordSet")
sql = "select * from buy_fs where wincost<>'0' "&ptype&" "&tj&" "&expect1&" "&addtime1&" order by addtime desc"
rs.open sql,conn,1
%>
<ul id="box1">
<li><%=rs("username")%>|<%=protype%>|<%=rs("expect")%>|<%=rs("onemoney")%>|<%=rs("wincost")%>|<%=mid(rs("addtime"),3,len(rs("addtime"))-5)%></li>
</ul>
<ul id="box2">
</ul>
</div>
<!-- -->
<div id="cc"> </div>
<script type="text/javascript">
var $$=function(id){return document.getElementById(id);}
var start;
$$('box2').innerHTML=$$('box1').innerHTML;
function roll(){
wrap.scrollTop++;
$$('cc').innerHTML=wrap.scrollTop;
if($$('box1').offsetHeight-wrap.scrollTop>0){
if(wrap.scrollTop%wrap.offsetHeight!=0)
{
return(setTimeout(roll,20));
}
else{
return(setTimeout(roll,2000));
}
}
else{
setTimeout("$$('wrap').scrollTop=0;roll()",2000);
}
}
setTimeout(roll,2000)
</script> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询