国模私拍 合集下载:关于asp的一点小问题?请教!

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 12:22:10
我想在下面这条语句所定义的消息框中把要显示的消息加上循环效果<table width="100%" height="30" border="0" cellpadding="1" cellspacing="1">
<%sql="select Top 5 * from Xy_Gt where GtFLag=1 and GtNew=1 order by GtDate Desc"
rs.open sql,conn,1,1
if rs.recordcount=0 then
response.write" 暂时还没有信息..."
else
while not rs.eof
%>
<tr>
<td height="25" class="Table4"><a href="DongInfo.asp?Id=<%=rs("GtId")%>#"><%=left(rs("GtName"),12)% >...</a></td>
</tr>
<%
rs.movenext
wend
end if
rs.close%>
我是这样做的加了2条语句在<%=left(rs("GtName"),12)%>... 上如下面:
<marquee scrollamount=1 scrolldelay=45 direction=up id=info onmouseover=info.stop() onmouseout=info.start()>
<%=left(rs("GtName"),12)%>...
</marquee>
但是这样不对,显示的结果是5条相同的
也就是说如果不加上面这条语句假设显示的是:
消息1
消息2
消息3
消息4
消息5
加了后会这样重复5次
我想可能是这条语句的问题sql="select Top 5 * from Xy_Gt where GtFLag=1 and GtNew=1 order by GtDate Desc" 但是我不知道怎么改才对
希望高手帮我解决一下,使显示的消息能够循环滚动,谢谢
由于经常问问题所以积分用完了,如果行的话以后加倍奉上.

你应该滚动整个代码
可以写成这样
<marquee scrollamount=1 scrolldelay=45 direction=up id=info onmouseover=info.stop() onmouseout=info.start()>
<table width="100%" height="30" border="0" cellpadding="1" cellspacing="1">
<%sql="select Top 5 * from Xy_Gt where GtFLag=1 and GtNew=1 order by GtDate Desc"
rs.open sql,conn,1,1
if rs.recordcount=0 then
response.write" 暂时还没有信息..."
else
while not rs.eof
%>
<tr>
<td height="25" class="Table4"><a href="DongInfo.asp?Id=<%=rs("GtId")%>#"><%=left(rs("GtName"),12)% >...</a></td>
</tr>
<%
rs.movenext
wend
end if
rs.close%></table>
</marquee>

这样就可以滚动所有的了

你应该把下面的: <marquee scrollamount=1 scrolldelay=45 direction=up id=info onmouseover=info.stop() onmouseout=info.start()>包围整个的循环结果,这样才是5条一起滚动,否则就是5条都滚动,当然显示5次了,建议把marquee的范围扩大些试试