+ -
当前位置:首页 → 问答吧 → 一段js代码只针对Firefox和opera无效

一段js代码只针对Firefox和opera无效

时间:2010-05-31

来源:互联网

本人业余喜欢学点web技术,套用0k3w的新闻发布系统自做了一个网站,其中一段首页图片滚播的js代码,自动提取被设置为“图片滚播”的文章中图片,在除了opera和Firefox外的所有浏览器均能正常显示,唯独此二者只显示背景色。本人对js不太懂,头都大了就是搞不明白,请求高人指点。
在http://www.jrzgltzzs.cn中可以查看效果,IE、Safari、chrome可以正常显示,Firefox、opera不显示,为了不至于空白,本人在
<%Call Ok3w_Article_ImgFlash("",322,280)%>调用代码之后加了一段js代码,针对这两个浏览器输出另一个flash。
下面是这段图片滚播的js代码,请高人分析哪里出了问题,应该如何修改?上述网站是本人的第一个web,很业余很垃圾,恳求指点,呵呵



Private Sub Ok3w_Article_ImgFlash(ClassID,Width,Height)
Randomize
RndID = Int(Rnd()*10000)
RndFun = "__Ok3w_Article_ImgFlash__00" & RndID
Response.Write "<script type=""text/javascript"">"
Response.Write "function " & RndFun & "()"
Response.Write "{"
       Sql="select top 5 Id,Title,PicFile,TitleColor,TitleURL from Ok3w_Article where ChannelID=1 and IsPass=1 and IsPlay=1 and IsDelete=0"
       If ClassID<>"" Then Sql=Sql & " and SortPath like '%," & ClassID & ",%'"
       Sql=Sql & " order by IsTop desc,IsCommend desc,Id desc"
       Rs.Open Sql,Conn,0,1
       pics = ""
       links = ""
       texts = ""
       Do While Not Rs.Eof
              ID = Rs("ID")
              Title = Rs("Title")
              PicFile = ReplaceUpFilePath(Rs("PicFile"))
              TitleURL = Rs("TitleURL")
              If TitleURL = "" Then TitleURL = Page_URL(ChannelID,"",ID)
              
              pics = pics & PicFile & "|"
              links = links & TitleURL & "|"
              texts = texts & Title & "|"
              Rs.MoveNext
       Loop
       Rs.Close
       If texts<>"" Then
              pics = Left(pics,Len(pics)-1)
              links = Left(links,Len(links)-1)
              texts = Left(texts,Len(texts)-1)
       End If
       
Response.Write "       var pics=""" & pics & """;"
Response.Write "       var links=""" & links & """;"
Response.Write "       var texts=""" & texts & """;"
       
Response.Write "       var focus_width=" & Width & ";"
Response.Write "       var focus_height=" & Height - 18 & ";"
Response.Write "       var text_height=18;"
Response.Write "       var swf_height = focus_height + text_height;"
       
Response.Write "       Ok3w_insertFlash(""" & Htmldns & """, focus_width, focus_height, swf_height, text_height, pics, links, texts);"
Response.Write "}"
Response.Write RndFun & "();"
Response.Write "</script>"



End Sub

作者: mortimer512   发布时间: 2010-05-31

相关阅读 更多

热门下载

更多