树形菜单

简介:           新闻测评                   外部             按资讯来源                                                                 按资讯类别                         ...

 <ul id="menuList">
    <li class="menubar">
     <a href="#" id="productsActuator" onClick="" class="actuator">新闻测评</a>
   
     <ul id="productsMenu" class="menu">
     <li>
      <a href="#" id="newPhonesActuator" class="actuator">外部</a>
      <ul id="newPhonesMenu" class="submenu">
       <li><a href="#" id="fromActuator" class="actuator">按资讯来源</a>
           <ul id="fromMenu" class="frommenu">
        <%set rs=server.createobject("adodb.recordset")
          rs.open "select * from News_Source",check_conn,1,3
          do while not rs.eof or bof%>
              <li><a href="#"><%=rs("News_Source_Name")%></a></li>
          <%rs.movenext
          loop
          rs.close%>
        </ul>
       </li>
       <li><a href="#" id="classActuator" class="actuator">按资讯类别</a>
           <ul id="classMenu" class="classmenu">
         <%
          rs.open "select * from News_Class",check_conn,1,3
          do while not rs.eof or bof%>
              <li><a href="#"><%=rs("News_Class_Name")%></a></li>
          <%rs.movenext
          loop
          rs.close%>
         </ul>
       </li>
      </ul>
     </li>
      <li>
      <a href="#" id="compareActuator" class="actuator">内部</a>
      <ul id="compareMenu" class="submenu">
       <li><a href="#" id="classActuatorIn" class="actuator">按资讯类别</a>
           <ul id="classMenuIn" class="classmenuin">
         <%
          rs.open "select * from News_Class",check_conn,1,3
          do while not rs.eof or bof%>
              <li><a href="#"><%=rs("News_Class_Name")%></a></li>
          <%rs.movenext
          loop
          rs.close%>
         </ul>
       </li>
      </ul>
     </li>
     </ul>
    </li>
   </ul>

 

 

js

function initializeMenu(menuId, actuatorId) {
 var menu = document.getElementById(menuId);
 var actuator = document.getElementById(actuatorId);
 if (menu == null || actuator == null) return;
 actuator.onclick = function() {
  var display = menu.style.display;
  menu.style.display = (display == "block") ? "none" : "block";
  return false;
 }
}
window.onload = function() {
 initializeMenu("productsMenu", "productsActuator");
 initializeMenu("newPhonesMenu", "newPhonesActuator");
 initializeMenu("compareMenu", "compareActuator");
 initializeMenu("fromMenu", "fromActuator");
 initializeMenu("classMenu", "classActuator");
 initializeMenu("classMenuIn", "classActuatorIn");
}

 

 

css

/* CSS Document */
#menuList {
 margin: 0px;
 padding: 10px 0px 10px 15px;
 width: 160px;
 background-color: #EEE;
 color: #000;
 font-family: verdana, helvetica, arial, sans-serif;
}

li.menubar {
 font-size: 12px;
 line-height: 1.8em;
 list-style: none;
}

.menu, .submenu, .frommenu, .classmenu, .classmenuin {
 display: none;
 margin-left: 15px;
 padding: 0px;
}

.menu li, .submenu li, .frommenu li, .classmenu li, .classmenuin li{
 list-style: none;
}

#menuList a {
 background-color: transparent;
 color: #000;
 font-size: 12px;
 margin-left: 15px;
 text-decoration: none;
}

#menuList a:hover {
 text-decoration: underline;
}

目录
相关文章
|
JavaScript 前端开发
52EasyUI 树形菜单- 树形菜单添加节点
52EasyUI 树形菜单- 树形菜单添加节点
53 0
|
JavaScript
原生js树形菜单
原生js树形菜单
48 0
57EasyUI 树形菜单- 创建复杂树形网格
57EasyUI 树形菜单- 创建复杂树形网格
58 0
58EasyUI 树形菜单- 树形网格动态加载
58EasyUI 树形菜单- 树形网格动态加载
42 0
|
前端开发 JavaScript 数据安全/隐私保护
Layui之动态树(树形菜单)详解1
Layui之动态树(树形菜单)详解1
373 0
|
1月前
|
JavaScript
jQuery 树型菜单插件(Treeview)
jQuery 树型菜单插件(Treeview)
59 2
|
11月前
|
算法 Java
layui实现左侧导航树形菜单
layui实现左侧导航树形菜单
660 0
layui实现左侧导航树形菜单
|
11月前
|
前端开发 Java 数据库
Layui之动态树 左侧树形菜单栏 详细全面
Layui之动态树 左侧树形菜单栏 详细全面
455 0
53EasyUI 树形菜单- 创建带复选框的树形菜单
53EasyUI 树形菜单- 创建带复选框的树形菜单
38 0
54EasyUI 树形菜单- 树形菜单拖放控制
54EasyUI 树形菜单- 树形菜单拖放控制
41 0