打开ks.LabelCls.asp
查找265行 函数名:KS_Rolls 到 423行'取得连续滚动图片换成以下代码就行了。。。
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'函数名:KS_Rolls
'作 用: 通用连续图片滚动函数
'参 数: ChannelID模块ID,SqlStr 待查询的SQL语句等
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Function KS_Rolls(ChannelID,SqlStr,M_Dir, M_Width, M_Height, OpenType, ShowTitle, Width, Height, M_Speed, T_Len, T_Css, BorderType, Border)
Dim ImgStr, TempPicStr, T_CssStr,Title, TempTitleStr, O_T_S,Url,TID
Dim SQL,K,RS:Set RS=Conn.Execute(SqlStr)
If RS.EOF Then KS_Rolls="":RS.Close:Set RS=Nothing:Exit Function
SQL=RS.GetRows(-1):RS.Close:Set RS = Nothing
T_CssStr = KS.GetCss(T_Css):O_T_S = KS.G_O_T_S(OpenType)
If LCase(M_Dir) = "left" Or LCase(M_Dir) = "right" Then
ImgStr = "<table width=""100%"" height=""100%"" border=""0"">" & vbCrLf
ImgStr = ImgStr & "<tr>" & vbCrLf
For K=0 To Ubound(SQL,2)
TID = SQL(2,K)
Title = SQL(1,K)
TempPicStr=GetPicUrl(SQL(7,K))
Url=KS.GetInfoUrl(ChannelID,SQL(2,K),SQL(0,K),SQL(5,K),SQL(3,K),SQL(4,K),SQL(6,K))
'-------------------------给图片加边框开始-------------------------------------------------
Dim TempBorder
If BorderType = 1 And Border <> "" Then
TempBorder = TempPicStr '得到原图片
TempPicStr = Border '将原图片设定为透明边框
Else
TempBorder = Border:TempPicStr = TempPicStr
End If
Dim LinkAndPicStr: LinkAndPicStr = "<a href=""" & Url & """" & O_T_S & " title=""" & Title & """><Img Src=""" & TempPicStr & """ border=""0"" width=""" & Width & """ height=""" & Height & """ align=""absmiddle""/></a>"
TempPicStr = KS.GetPhotoBorder(LinkAndPicStr, BorderType, TempBorder)
'-----------------------给图片加边框结束--------------------------------------------------
TempTitleStr = "<a" & T_CssStr & " href=""" & Url & """" & O_T_S & " title=""" & Title & """>" & KS.GotTopic(Title, T_Len) & "</a>"
ImgStr = ImgStr & "<td>" & vbCrLf
ImgStr = ImgStr & "<table boder=""0"" width=""100%"" height=""100%"">" & vbCrLf
ImgStr = ImgStr & "<tr><td align=""center"">" & TempPicStr & "</td></tr>" & vbCrLf
If Cbool(ShowTitle) = True Then
ImgStr = ImgStr & "<tr><td align=""center"">" & TempTitleStr & " </td></tr>" & vbCrLf
End If
ImgStr = ImgStr & "</table>" & vbCrLf
ImgStr = ImgStr & "</td>" & vbCrLf
Next
ImgStr = ImgStr & "</tr></table>" & vbCrLf
Else
ImgStr = "<table width=""100%"" height=""100%"" border=""0"">" & vbCrLf
For K=0 To Ubound(SQL,2)
Title = SQL(1,K)
TempPicStr=GetPicUrl(SQL(7,K))
Url=KS.GetInfoUrl(ChannelID,SQL(2,K),SQL(0,K),SQL(5,K),SQL(3,K),SQL(4,K),SQL(6,K))
'-------------------------给图片加边框开始-------------------------------------------------
If BorderType = 1 And Border <> "" Then
TempBorder = TempPicStr '得到原图片
TempPicStr = Border '将原图片设定为透明边框
Else
TempBorder = Border
TempPicStr = TempPicStr
End If
LinkAndPicStr = "<a href=""" & URL & """" & O_T_S & " title=""" & Title & """><Img Src=""" & TempPicStr & """ border=""0"" width=""" & Width & """ height=""" & Height & """ align=""absmiddle""/></a>"
TempPicStr = KS.GetPhotoBorder(LinkAndPicStr, BorderType, TempBorder)
'-----------------------给图片加边框结束--------------------------------------------------
TempTitleStr = "<a" & T_CssStr & " href=""" & URL & """" & O_T_S & " title=""" & Title & """>" & KS.GotTopic(Title, T_Len) & "</a>"
ImgStr = ImgStr & "<tr><td>" & vbCrLf
ImgStr = ImgStr & "<table boder=""0"" width=""100%"" height=""100%"">" & vbCrLf
ImgStr = ImgStr & "<tr><td align=""center"">" & TempPicStr & "</td></tr>" & vbCrLf
If Cbool(ShowTitle) = True Then ImgStr = ImgStr & "<tr><td align=""center"">" & TempTitleStr & " </td></tr>" & vbCrLf
ImgStr = ImgStr & "</table>" & vbCrLf
ImgStr = ImgStr & "</td></tr>" & vbCrLf
Next
ImgStr = ImgStr & "</table>" & vbCrLf
End If
Select Case M_Dir
Case "up"
KS_Rolls = KS_Rolls & "<div id=demoup"& TID &" style=""overflow:hidden; width:" & M_Width & "px; height:" & M_Height & "px;"" > " & vbCrLf
KS_Rolls = KS_Rolls & "<div id=demoup"& TID &"1>" & vbCrLf
KS_Rolls = KS_Rolls & ImgStr
KS_Rolls = KS_Rolls & "</div>" & vbCrLf
KS_Rolls = KS_Rolls & "<div id=demoup"& TID &"2></div>" & vbCrLf
KS_Rolls = KS_Rolls & "</div>" & vbCrLf
KS_Rolls = KS_Rolls & "<script language=""javascript"">" & vbCrLf
KS_Rolls = KS_Rolls & " var upspeed"& TID &" = " & M_Speed & ";" & vbCrLf
KS_Rolls = KS_Rolls & " demoup"& TID &"2.innerHTML = demoup"& TID &"1.innerHTML;" & vbCrLf
KS_Rolls = KS_Rolls & " function MarqueeUP"& TID &"(){" & vbCrLf
KS_Rolls = KS_Rolls & " if(demoup"& TID &"2.offsetTop-demoup"& TID &".scrollTop<=0)" & vbCrLf
KS_Rolls = KS_Rolls & " demoup"& TID &".scrollTop-=demoup"& TID &"1.offsetHeight" & vbCrLf
KS_Rolls = KS_Rolls & " else{" & vbCrLf
KS_Rolls = KS_Rolls & " demoup"& TID &".scrollTop++" & vbCrLf
KS_Rolls = KS_Rolls & "}" & vbCrLf
KS_Rolls = KS_Rolls & "}" & vbCrLf
KS_Rolls = KS_Rolls & "var MyMarUP"& TID &" = setInterval(MarqueeUP"& TID &", upspeed"& TID &")" & vbCrLf
KS_Rolls = KS_Rolls & "demoup"& TID &".onmouseover=function() {clearInterval(MyMarUP"& TID &")}" & vbCrLf
KS_Rolls = KS_Rolls & "demoup"& TID &".onmouseout=function() {MyMarUP"& TID &"=setInterval(MarqueeUP"& TID &",upspeed"& TID &")}" & vbCrLf
KS_Rolls = KS_Rolls & "</script>" & vbCrLf
Case "down"
KS_Rolls = KS_Rolls & "<div id=demodown"& TID &" style=""overflow:hidden; width:" & M_Width & "px; height:" & M_Height & "px;"">" & vbCrLf
KS_Rolls = KS_Rolls & "<div id=demodown"& TID &"1>" & vbCrLf
KS_Rolls = KS_Rolls & ImgStr
KS_Rolls = KS_Rolls & "</div>" & vbCrLf
KS_Rolls = KS_Rolls & "<div id=demodown"& TID &"2></div>" & vbCrLf
KS_Rolls = KS_Rolls & "</div>" & vbCrLf
KS_Rolls = KS_Rolls & "<script language=""javascript"">" & vbCrLf
KS_Rolls = KS_Rolls & "var downspeed"& TID &" = " & M_Speed & ";" & vbCrLf
KS_Rolls = KS_Rolls & "demodown"& TID &"2.innerHTML = demodown"& TID &"1.innerHTML;" & vbCrLf
KS_Rolls = KS_Rolls & "demodown"& TID &".scrollTop = demodown"& TID &".scrollHeight" & vbCrLf
KS_Rolls = KS_Rolls & "function MarqueeDown"& TID &"(){" & vbCrLf
KS_Rolls = KS_Rolls & "if(demodown"& TID &"1.offsetTop-demodown"& TID &".scrollTop>=0)" & vbCrLf
KS_Rolls = KS_Rolls & "demodown"& TID &".scrollTop+=demodown"& TID &"2.offsetHeight" & vbCrLf
KS_Rolls = KS_Rolls & "else{" & vbCrLf
KS_Rolls = KS_Rolls & "demodown"& TID &".scrollTop--" & vbCrLf
KS_Rolls = KS_Rolls & "}}" & vbCrLf
KS_Rolls = KS_Rolls & "var MyMardown"& TID &" = setInterval(MarqueeDown"& TID &", downspeed"& TID &")" & vbCrLf
KS_Rolls = KS_Rolls & "demodown"& TID &".onmouseover=function() {clearInterval(MyMardown"& TID &")}" & vbCrLf
KS_Rolls = KS_Rolls & "demodown"& TID &".onmouseout=function() {MyMardown"& TID &"=setInterval(MarqueeDown"& TID &",downspeed"& TID &")}" & vbCrLf
KS_Rolls = KS_Rolls & "</script>" & vbCrLf
Case "left"
KS_Rolls = KS_Rolls & "<div id=demoleft"& TID &" style=""overflow:hidden;height:" & M_Height & "px;width:" & M_Width & "px;"">" & vbCrLf
KS_Rolls = KS_Rolls & "<table align=left cellpadding=0 cellspace=0 border=0>" & vbCrLf
KS_Rolls = KS_Rolls & "<tr><td id=demoleft"& TID &"1 valign=top>" & vbCrLf
KS_Rolls = KS_Rolls & ImgStr
KS_Rolls = KS_Rolls & "</td>" & vbCrLf
KS_Rolls = KS_Rolls & "<td id=demoleft"& TID &"2 valign=top></td>" & vbCrLf
KS_Rolls = KS_Rolls & "</tr></table>" & vbCrLf
KS_Rolls = KS_Rolls & "</div>" & vbCrLf
KS_Rolls = KS_Rolls & "<script laguage=""javascript"">" & vbCrLf
KS_Rolls = KS_Rolls & "var leftspeed"& TID &" = " & M_Speed & ";" & vbCrLf
KS_Rolls = KS_Rolls & "demoleft"& TID &"2.innerHTML = demoleft"& TID &"1.innerHTML" & vbCrLf
KS_Rolls = KS_Rolls & "function MarqueeLeft"& TID &"(){" & vbCrLf
KS_Rolls = KS_Rolls & "if(demoleft"& TID &"2.offsetWidth-demoleft"& TID &".scrollLeft<=0)" & vbCrLf
KS_Rolls = KS_Rolls & "demoleft"& TID &".scrollLeft-=demoleft"& TID &"1.offsetWidth" & vbCrLf
KS_Rolls = KS_Rolls & "else{" & vbCrLf
KS_Rolls = KS_Rolls & "demoleft"& TID &".scrollLeft++" & vbCrLf
KS_Rolls = KS_Rolls & "}}" & vbCrLf
KS_Rolls = KS_Rolls & "var MyMarleft"& TID &" = setInterval(MarqueeLeft"& TID &", leftspeed"& TID &")" & vbCrLf
KS_Rolls = KS_Rolls & "demoleft"& TID &".onmouseover=function() {clearInterval(MyMarleft"& TID &")}" & vbCrLf
KS_Rolls = KS_Rolls & "demoleft"& TID &".onmouseout=function() {MyMarleft"& TID &"=setInterval(MarqueeLeft"& TID &",leftspeed"& TID &")}" & vbCrLf
KS_Rolls = KS_Rolls & "</script>" & vbCrLf
Case "right"
KS_Rolls = KS_Rolls & "<div id=demoright"& TID &" style=""overflow:hidden;height:" & M_Height & "px;width:" & M_Width & "px;"">" & vbCrLf
KS_Rolls = KS_Rolls & "<table align=left cellpadding=0 cellspace=0 border=0><tr><td id=demoright"& TID &"1 valign=top>" & vbCrLf
KS_Rolls = KS_Rolls & ImgStr
KS_Rolls = KS_Rolls & "</td><td id=demoright"& TID &"2 valign=top></td></tr></table></div>" & vbCrLf
KS_Rolls = KS_Rolls & "<script>" & vbCrLf
KS_Rolls = KS_Rolls & "var rightspeed"& TID &" = " & M_Speed & ";" & vbCrLf
KS_Rolls = KS_Rolls & "demoright"& TID &"2.innerHTML = demoright"& TID &"1.innerHTML;" & vbCrLf
KS_Rolls = KS_Rolls & "demoright"& TID &".scrollLeft = demoright"& TID &".scrollWidth;" & vbCrLf
KS_Rolls = KS_Rolls & "function MarqueeRight"& TID &"(){" & vbCrLf
KS_Rolls = KS_Rolls & "if(demoright"& TID &".scrollLeft<=0)" & vbCrLf
KS_Rolls = KS_Rolls & "demoright"& TID &".scrollLeft+=demoright"& TID &"2.offsetWidth" & vbCrLf
KS_Rolls = KS_Rolls & "else{" & vbCrLf
KS_Rolls = KS_Rolls & "demoright"& TID &".scrollLeft--" & vbCrLf
KS_Rolls = KS_Rolls & "}}" & vbCrLf
KS_Rolls = KS_Rolls & "var MyMarRight"& TID &" = setInterval(MarqueeRight"& TID &", rightspeed"& TID &")" & vbCrLf
KS_Rolls = KS_Rolls & "demoright"& TID &".onmouseover=function() {clearInterval(MyMarRight"& TID &")}" & vbCrLf
KS_Rolls = KS_Rolls & "demoright"& TID &".onmouseout=function() {MyMarRight"& TID &"=setInterval(MarqueeRight"& TID &",rightspeed"& TID &")}" & vbCrLf
KS_Rolls = KS_Rolls & "</script>" & vbCrLf
End Select
End Function
'取得连续滚动图片