X
xupengcn
Unregistered / Unconfirmed
GUEST, unregistred user!
我没学过jsp但是领导让我在办公网上加两个滚动字幕,一个是公告(纵向滚动的),一个是消息(横向滚动的)。我试验性的写了一段纵向滚动的公告代码,但是不对。源码如下,那位能帮忙看看为什么显示的结果都一样,而且横向的消息应该怎么写。
如果那位有源码的例子给我万分感谢!
<%
Set Cnn = Server.CreateObject("ADODB.Connection"
StrCnn = "Provider=sqloledb;
User ID=sa;
Password=123456;
Initial Catalog=aaa;
Data Source=bbb"
Cnn.Open StrCnn
set rs=server.createobject("adodb.recordset"
sql="SELECT nr from gg order by ID"
rs.open sql,cnn,1,1
rs.movefirst
aa=rs.recordcount
%>
<script language=JavaScript class=5v>
document.write ("<marquee scrollamount='1' scrolldelay='20' direction= 'up' width='160' id=helpor_net height='175' onmouseover=helpor_net.stop() onmouseout=helpor_net.start() Author:redriver;
For more,visit:www.qqqqqq.com>"
document.write ("<p><font color=#000000 size=2> "
if (<%=aa%> < 1)
do
cument.write ("<p>还 没 有 任 何 公 告</p>"
else
for(i=1;i<= <%=aa%>;i++)
{
do
cument.write ("<%=rs("nr"%>"
<%rs.movenext%>
do
cument.write ("<br>"
}
document.write ("</font>"
document.write ("</marquee> "
</script>
sql server表结构:
1、表名 gg(滚动公告)
id int
nr varchar
2、表名 gdxx(滚动消息)
id int
nr varchar
如果那位有源码的例子给我万分感谢!
<%
Set Cnn = Server.CreateObject("ADODB.Connection"
StrCnn = "Provider=sqloledb;
User ID=sa;
Password=123456;
Initial Catalog=aaa;
Data Source=bbb"
Cnn.Open StrCnn
set rs=server.createobject("adodb.recordset"
sql="SELECT nr from gg order by ID"
rs.open sql,cnn,1,1
rs.movefirst
aa=rs.recordcount
%>
<script language=JavaScript class=5v>
document.write ("<marquee scrollamount='1' scrolldelay='20' direction= 'up' width='160' id=helpor_net height='175' onmouseover=helpor_net.stop() onmouseout=helpor_net.start() Author:redriver;
For more,visit:www.qqqqqq.com>"
document.write ("<p><font color=#000000 size=2> "
if (<%=aa%> < 1)
do
cument.write ("<p>还 没 有 任 何 公 告</p>"
else
for(i=1;i<= <%=aa%>;i++)
{
do
cument.write ("<%=rs("nr"%>"
<%rs.movenext%>
do
cument.write ("<br>"
}
document.write ("</font>"
document.write ("</marquee> "
</script>
sql server表结构:
1、表名 gg(滚动公告)
id int
nr varchar
2、表名 gdxx(滚动消息)
id int
nr varchar