-- 作者:xiamenhuli_xujh
-- 发布时间:1/12/2010 11:14:00 AM
-- [求助]这段代码怎么不能实现滚动,请帮忙,感激。
<% Dim sSQL, rs, sCrLf, sXmlClear, sRssHead, sRssEnd,db,s_Conn sCrLf = chr(13) & chr(10) '回车+换行 db="database/adsfkldfogowerjnokfdslwejhdfsjhk22.mdb" '数据库文件的位置 Set conn = Server.CreateObject("ADODB.Connection") s_Conn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db) conn.Open s_Conn sXmlClear = "<?xml version='1.0' encoding='gb2312'?>" & sCrLf sRssHead = "<rss version='2.0'>" & sCrLf sRssHead = sRssHead & "<channel>" & sCrLf sRssHead = sRssHead & "<title>RSS创建示例</title>" & sCrLf sRssHead = sRssHead & "<description> RSS创建示例</description>" & sCrLf sRssHead = sRssHead & "<link>http://1234.com/</link>" & sCrLf sRssHead = sRssHead & "<language>zh-cn</language>" & sCrLf sRssHead = sRssHead & "<docs>RSS创建示例r</docs>" & sCrLf sRssHead = sRssHead & "<generator>Rss Generator By 1234.com</generator>" & sCrLf sRssEnd = "</channel></rss>" function dvHTMLCode(byval fString) if isnull(fString) or trim(fString)="" then dvHTMLCode="" exit function end if fString = replace(fString, ">", ">") fString = replace(fString, "<", "<") fString = Replace(fString, " "," ") fString = Replace(fString, """, CHR(34)) fString = Replace(fString, "'", CHR(39)) fString = Replace(fString, "</P><P> ",CHR(10) & CHR(10)) fString = Replace(fString, "<BR> ", CHR(10)) fString = Replace(fString, CHR(10),"<BR> ") dvHTMLCode = fString end function 'response.Clear() Response.CharSet="gb2312" '数据集 %> <html> <head> <head> <meta http-equiv="content-type" content="text/html; charset=gb2312" /> <meta http-equiv="content-language" content="zh-cn" /> <title>内网输出</title> </head> </head> <body> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="220" height="22"> <tr> <td width="100%"> <div id="maq" style="overflow:hidden;width: 318px; height: 93px;backcolor:#FFFFFF"> <div id="mtext"> <% response.Clear() 'Response.ContentType="text/xml; charset=gb2312" '数据流格式定义 '输出: Response.write sXmlClear Response.write sRssHead sSQL="select top 100 * from Article order by ArticleID desc" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sSQL, s_Conn, 1, 1 if not (rs.eof and rs.bof) then do while not rs.eof Response.ContentType="text/xml; charset=gb2312" '数据流格式定义 response.write "<item>" & sCrLf response.write "<title> " & rs("Title") & " </title>" & sCrLf 'response.write "<description><![CDATA["& dvHTMLCode(rs("Content")) &"]]></description>" & sCrLf 'response.write "<link> " & "http://www.1234.com/_news/show_a_new.asp?autoid=" & rs("f_i_autoid") & " </link>" & sCrLf response.write "<author> " & rs("Author") & " </author>" & sCrLf 'response.write "<pubDate> " & rs("f_datetime") & " </pubDate>" & sCrLf response.write "</item>" & sCrLf & sCrLf rs.movenext loop end if rs.close set rs=nothing Response.write sRssEnd%> </div> <div id="m0"></div> </div> <script> var speed=100 //调整滚动速度 m0.innerHTML=mtext.innerHTML function Marquee(){ if(m0.offsetTop-maq.scrollTop<=0) maq.scrollTop-=mtext.offsetHeight else{ maq.scrollTop++ } } var MyMar=setInterval(Marquee,speed) maq.onmouseover=function() {clearInterval(MyMar)} maq.onmouseout=function() {MyMar=setInterval(Marquee,speed)} </script> </td> </tr> </table> </body> </html> 这段代码怎么不能实现滚动,请帮忙,感激。
|