会员登陆
登录加载中...
超级搜索
栏  目  
类  别  
关键词  
 站内搜索   网络搜索
  
 当前位置:教程首页>>Pro版本>>Pro V2.X版本>>V2.0版本头部导航横向二级菜单
推荐给你的朋友阅读:

V2.0版本头部导航横向二级菜单

来源:飞腾设计网 发表日期: 2007-11-05 16:02:08

    FeitecCMS Pro V2.0 版本目前支持横向导航二级菜单。目前Table版本只有海蓝清雅加入了此导航,现将横向二级菜单代码记录如下,供有能力的客户修改——

    1、以下JS代码加入到Ft_IncJs.js中(客户不用作此步,因为在安装包中此文件已内置此JS):

    var tID = "nav1";
    function showmenuline(ID){
      if(ID!=tID){
     var IDObj = document.getElementById( ID );
     var tIDObj = document.getElementById( tID );
     var IDObj_content = document.getElementById( ID + "_" );
     var tIDObj_content = document.getElementById( tID + "_" );
         IDObj.className='nav_link_02';
         tIDObj.className='nav_link_01';
       tIDObj_content.style.display='none';
       IDObj_content.style.display='';
         tID=ID;
      }
    }

    2、在外观设置——网站界面风格总管理——总风格模板中的CSS子模块,加入以下CSS(注意:修改了此CSS后,必须勾选“重建CSS”选项——

    /*导航样式开始*/
    #menu {
      background:url(menu_bg0.gif) repeat-x;
      clear:both;
      margin: 0 auto;
      width:960px;
      height:52px;
      color:#fff;
      padding:0;
    }
    .mainmenu {
      width:100%;
      height:22px;
      color:#fff;
      border:0px;
    }
    .nav_link_01 {
      background:url(menu_a0.gif) no-repeat;
      float:left;
      width:72px;
      height:17px;
      padding-top:6px;
      font-size:13px;
      text-align:center;
      cursor:pointer;
     
    }
    .nav_link_02 {
      background:url(menu_b0.gif) no-repeat;
      float:left;
      width:72px;
      height:19px;
      padding-top:6px;
      margin-bottom:1px;
      text-align:center;
      cursor:pointer;
      font-size:13px;
    }
    .nav_link_01 a:link,.nav_link_01 a:visited  {
      color: #000;
      text-decoration: none;
    }
    .nav_link_01 a:hover {
      color: #F60;
      text-decoration: none;
    }
    .nav_link_02 a:link,.nav_link_02 a:visited {
      color: #fff;
      text-decoration: none;
      font-weight:bold;
    }
    .nav_link_02 a:hover {
      color: #ff0;
      text-decoration: none;
      font-weight:bold;
    }
    .submenu{
     height:27px;
     border-right:#328CD6 solid 1px;
     line-height:27px;
     vertical-align:middle;
    }
    .submenu ul{margin:0}
    .submenu li {
     background: url(ico.gif) no-repeat 10px 8px;
     float: left;
     font-size:12px;
     padding-left:18px;
     list-style-type:none;
     height:27px;
     line-height:27px;
    }
    .submenu li a:link,.submenu li a:visited {
      color: #fff;
      display: block;
      text-decoration: none;
      border:2px solod #f00;
    }
    .submenu li a:hover {
      color: #ff0;
      text-decoration: none;
    }
    .cle_fl {CLEAR: both}
    /*导航样式结束*/

    CSS中的几张图片路径必须放于此风格的安装包中,即与CSS同一个目录。下面是这几张图片,可通过另存的方式加以保存——

                              

    3、在Ft_Function.asp文件中,加入以下内容——

    (1)、GetMenu3():

    '==================================
    '=函 数 名:GetMenu3()
    '=功    能:主导航菜单显示[风格默认采用,模板标签为$Menu3$]
    '==================================
    Function GetMenu3()
    If Application(Site&"_topmenu3")=Empty Then
     Dim Tmp,MenuDisplay,MenuCss,Sql2,RsMenu,Pop,MenuList,Str
     i=0
     Str="<div class=""mainmenu"">"&vbCrLf
     Sql="Select Id,Name,Url,Target From Ft_Menu Where Items=0 And Shown=True And NavWz=1 Order By Order_Num"
     Set Rs=Conn.Execute(Sql)
     Do While Not Rs.Eof
      MenuDisplay="DISPLAY: none":MenuCss="nav_link_01"
      If i=0 Then MenuDisplay="DISPLAY: block":MenuCss="nav_link_02"
      Pop="<div class="""&MenuCss&""" id=""nav"&i+1&""" onmouseover=""showmenuline('nav"&i+1&"')""><a href="""&Rs(2)&""" target="""&Rs(3)&""">"&Rs(1)&"</a></div>"
      Sql2 = "Select Name,Url From Ft_Menu Where Shown=True And Items="&Rs(0)
      Set Rs2 = Conn.Execute(Sql2)
      If Rs2.Bof And Rs2.Eof Then
       If Rs(0)=2 Then '新闻资询
        Tmp = Tmp&"<div class=""submenu"" id=""nav"&i+1&"_"" style="""&MenuDisplay&"""><ul>"&vbCrLf
        Set RsMenu = Conn.Execute("Select Cat_Id,Cat_Name From Ft_News_Cat Order By Cat_Id")
        Do While Not RsMenu.Eof
        Tmp = Tmp&"<li><a href=""News.asp?cat_id="&RsMenu(0)&""" target="""&Rs(3)&""">"&RsMenu(1)&"</a></li>"&vbCrLf 
        RsMenu.MoveNext
        Loop
        RsMenu.Close:Set RsMenu=Nothing
        Tmp = Tmp&"</ul></div>"&vbCrLf
       ElseIf Rs(0)=3 Then'超酷素材
        Tmp = Tmp&"<div class=""submenu"" id=""nav"&i+1&"_"" style="""&MenuDisplay&"""><ul>"&vbCrLf
        Set RsMenu = Conn.Execute("Select Cat_Id,Cat_Name From Ft_Pic_Cat Order By Cat_Id")
        Do While Not RsMenu.Eof
        Tmp = Tmp&"<li><a href=""Pic.asp?cat_id="&RsMenu(0)&""" target="""&Rs(3)&""">"&RsMenu(1)&"</a></li>"&vbCrLf 
        RsMenu.MoveNext
        Loop
        RsMenu.Close:Set RsMenu=Nothing
        Tmp = Tmp&"</ul></div>"&vbCrLf
       ElseIf Rs(0)=4 Then'精彩文章
        Tmp = Tmp&"<div class=""submenu"" id=""nav"&i+1&"_"" style="""&MenuDisplay&"""><ul>"&vbCrLf
        Set RsMenu = Conn.Execute("Select Cat_Id,Cat_Name From Ft_Art_Cat Order By Cat_Id")
        Do While Not RsMenu.Eof
        Tmp = Tmp&"<li><a href=""Article.asp?cat_id="&RsMenu(0)&""" target="""&Rs(3)&""">"&RsMenu(1)&"</a></li>"&vbCrLf 
        RsMenu.MoveNext
        Loop
        RsMenu.Close:Set RsMenu=Nothing
        Tmp = Tmp&"</ul></div>"&vbCrLf
       ElseIf Rs(0)=5 Then '软件下载
        Tmp = Tmp&"<div class=""submenu"" id=""nav"&i+1&"_"" style="""&MenuDisplay&"""><ul>"&vbCrLf
        Set RsMenu = Conn.Execute("Select Cat_Id,Cat_Name From Ft_Soft_Cat Order By Cat_Id")
        Do While Not RsMenu.Eof
        Tmp = Tmp&"<li><a href=""Download.asp?cat_id="&RsMenu(0)&""" target="""&Rs(3)&""">"&RsMenu(1)&"</a></li>"&vbCrLf 
        RsMenu.MoveNext
        Loop
        RsMenu.Close:Set RsMenu=Nothing
        Tmp = Tmp&"</ul></div>"&vbCrLf
       ElseIf Rs(0)=6 Then 'Produ
        Tmp = Tmp&"<div class=""submenu"" id=""nav"&i+1&"_"" style="""&MenuDisplay&"""><ul>"&vbCrLf
        Set RsMenu = Conn.Execute("Select Cat_Id,Cat_Name From Ft_Produ_cat Order By Cat_Id")
        Do While Not RsMenu.Eof
        Tmp = Tmp&"<li><a href=""Produ.asp?cat_id="&RsMenu(0)&""" target="""&Rs(3)&""">"&RsMenu(1)&"</a></li>"&vbCrLf 
        RsMenu.MoveNext
        Loop
        RsMenu.Close:Set RsMenu=Nothing
        Tmp = Tmp&"</ul></div>"&vbCrLf 
       ElseIf Rs(0)=7 Then'Dj
        Tmp = Tmp&"<div class=""submenu"" id=""nav"&i+1&"_"" style="""&MenuDisplay&"""><ul>"&vbCrLf
        Set RsMenu = Conn.Execute("Select Cat_Id,Cat_Name From Ft_Dj_cat Order By Cat_Id")
        Do While Not RsMenu.Eof
        Tmp = Tmp&"<li><a href=""Dj.asp?cat_id="&RsMenu(0)&""" target="""&Rs(3)&""">"&RsMenu(1)&"</a></li>"&vbCrLf 
        RsMenu.MoveNext
        Loop
        RsMenu.Close:Set RsMenu=Nothing
        Tmp = Tmp&"</ul></div>"&vbCrLf
       ElseIf Rs(0)=8 Then'Course
        Tmp = Tmp&"<div class=""submenu"" id=""nav"&i+1&"_"" style="""&MenuDisplay&"""><ul>"&vbCrLf
        Set RsMenu = Conn.Execute("Select Cat_Id,Cat_Name From Ft_Course_cat Order By Cat_Id")
        Do While Not RsMenu.Eof
        Tmp = Tmp&"<li><a href=""Course.asp?cat_id="&RsMenu(0)&""" target="""&Rs(3)&""">"&RsMenu(1)&"</a></li>"&vbCrLf 
        RsMenu.MoveNext
        Loop
        RsMenu.Close:Set RsMenu=Nothing
        Tmp = Tmp&"</ul></div>"&vbCrLf
       ElseIf Rs(0)=9 Then'Skin
        Tmp = Tmp&"<div class=""submenu"" id=""nav"&i+1&"_"" style="""&MenuDisplay&"""><ul>"&vbCrLf
        Set RsMenu = Conn.Execute("Select Mb_Id,Mb_Name From Ft_Mb_Style Order By Mb_Id")
        Do While Not RsMenu.Eof
        Tmp = Tmp&"<li><a href=""Index.asp?skin="&RsMenu(0)&""">"&RsMenu(1)&"</a></li>"&vbCrLf 
        RsMenu.MoveNext
        Loop
        RsMenu.Close:Set RsMenu=Nothing
        Tmp = Tmp&"</ul></div>"&vbCrLf
       Else
        Tmp = Tmp&"<div class=""submenu"" id=""nav"&i+1&"_"" style="""&MenuDisplay&"""><ul><li>"&SiteSetting(0)&"</li></ul></div>"&vbCrLf
       End If
      Else
       Tmp = Tmp&"<div class=""submenu"" id=""nav"&i+1&"_"" style="""&MenuDisplay&"""><ul>"&vbCrLf
       Do While Not Rs2.Eof
        Tmp = Tmp&"<li><a href="""&Rs2(1)&""" target="""&Rs(3)&""">"&Rs2(0)&"</a></li>"&vbCrLf
        Rs2.MoveNext
       Loop
       Tmp = Tmp&"</ul></div>"&vbCrLf
      End If
      Rs2.Close:Set Rs2=Nothing
      i=i+1
      MenuList=MenuList+Pop
      Pop=""
      Rs.MoveNext
     Loop
     Rs.Close:Set Rs=Nothing
     Str=Str+MenuList+"</div><div class=""cle_fl""></div>"&vbCrLf
     Str=Str+Tmp
     GetMenu3=Str
     Application(Site&"_topmenu3")=Str
     GetMenu3=Application(Site&"_topmenu3")
    Else
     GetMenu3=Application(Site&"_topmenu3")
    End If
    End Function

    (2)、搜索Str=Replace(Str,"$Menu2$",GetMenu2()),在其下面一行加入:

    Str=Replace(Str,"$Menu3$",GetMenu3())

    4、进入网站界面风格总管理——总风格模板——页面头部模板,加入以下代码——

    (1)、对于Table版本,加入以下代码(以海蓝清雅为例):

<table class="maintable" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border:0px solid #C2C2C2;"  align="center" >
     <tbody>
     <tr>
      <td align="right" height="52"><div id="menu">$Menu3$</div></td>
     </tr>
    </table>

    即在一个普通表格外面加入以下代码——

<div id="menu">$Menu3$</div>

    就可以实现页面头部导航横向二级菜单效果啦。演示:Index.asp?skin=46

    (2)、对于DIV+Css版本,以后加入。

0
0
[作者:raincity 关键词:导航,横向二级,Pro 录入:raincity 责编:raincity 阅读次数:2985]
上一记录:批量替换SKINS内容标签
下一记录:没有下一条记录

相关文章 相关新闻 相关软件 相关教程 公共评论 发表评论

    评论载入中...
    您的称呼  验 证 码   
    您的评论 [ 最多字数:  已用字数:剩余字数:]

     
COPYRIGHT 2003-2010 创意飞腾科技有限公司(The Feitec LTD.) ALL RIGHTS RESERVED .
官方咨询官方咨询4376161 官方咨询526743959 技术支持:FeitecCMS5366464
页面加载时间:140.63ms Powered By:FeitecCMS V4.0(Build1101)
[蜀ICP备05000881]