账号通
    

账号  

密码  

3871

查看

7

回复
主题:[分享]实现一个页面多个滚动图片. [收藏主题] 本贴被认定为精华 转到:  
nianjin 当前离线

125

主题

0

广播

0

粉丝
添加关注
级别:一年级

用户积分:1510 分
登录次数:102 次
注册时间:2007/4/13
最后登录:2011/7/31
nianjin 发表于:2007/10/10 16:41:00   | 只看该作者 查看该作者主题 楼主 
做在线知识付费 选科汛云开店

打开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
  '取得连续滚动图片

 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
maoer 当前离线

928

主题

0

广播

0

粉丝
添加关注
级别:七年级

用户积分:4734 分
登录次数:104 次
注册时间:2007/8/17
最后登录:2008/2/23
maoer 发表于:2007/10/12 18:15:00   | 只看该作者 查看该作者主题 沙发 
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
zhenming 当前离线

887

主题

0

广播

0

粉丝
添加关注
级别:七年级

用户积分:4797 分
登录次数:125 次
注册时间:2007/8/7
最后登录:2009/9/11
zhenming 发表于:2007/10/11 17:57:00   | 只看该作者 查看该作者主题 藤椅 
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
平静的生活 当前离线

604

主题

0

广播

0

粉丝
添加关注
级别:六年级

用户积分:2867 分
登录次数:64 次
注册时间:2007/7/27
最后登录:2008/1/30
平静的生活 发表于:2007/10/11 13:17:00   | 只看该作者 查看该作者主题 板凳 
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
maoer 当前离线

928

主题

0

广播

0

粉丝
添加关注
级别:七年级

用户积分:4734 分
登录次数:104 次
注册时间:2007/8/17
最后登录:2008/2/23
maoer 发表于:2007/10/11 12:15:00   | 只看该作者 查看该作者主题 报纸 
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
d2wl 当前离线

333

主题

0

广播

0

粉丝
添加关注
级别:三年级

用户积分:2143 分
登录次数:255 次
注册时间:2007/6/17
最后登录:2013/2/27
d2wl 发表于:2007/10/11 11:22:00   | 只看该作者 查看该作者主题 地板 
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
天下无语 当前离线

1259

主题

11

广播

1

粉丝
添加关注
级别:九年级

用户积分:9743 分
登录次数:1540 次
注册时间:2007/4/1
最后登录:2024/1/8
天下无语 发表于:2007/10/11 7:58:00   | 只看该作者 查看该作者主题 7楼 
具体说说修改后如何使用啊
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
科汛官方 当前离线

47268

主题

145

广播

405

粉丝
添加关注
级别:管理员

用户积分:101604 分
登录次数:7935 次
注册时间:2006/12/7
最后登录:2023/12/14
科汛官方 发表于:2007/10/10 17:32:00   | 只看该作者 查看该作者主题 8楼 
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
<上一主题 | 下一主题 >
Powered By KesionCMS Version X1
厦门科汛软件有限公司 © 2006-2016 页面执行0.22266秒 powered by KesionCMS 9.0