zoukankan      html  css  js  c++  java
  • jquery tree

       <div class="fl left"  id="nav" style="18%" >
                    <div class="leftnav">商品分类</div>
                    <ul class="sui-nav nav-list nav-large mt10">
                       <li class="nav-header" >
                           <i class="sui-icon icon-touch-folder-right-sign"></i>
                           一级菜单
                           <ul class="sui-nav nav-list nav-large" style="display: none">
                               <li class="nav-header">
                                   <i class="sui-icon icon-touch-folder-right-sign"></i>
                                   二级菜单
                                   <ul class="sui-nav nav-list nav-large" style="display: none">
                                       <li class="nav-header">
                                           <i class="sui-icon icon-touch-folder-right-sign"></i>
                                           三级菜单
                                       </li>
                                       <li style="display: none"><a>菜单子项 </a></li>
                                   </ul>
                               </li>
                               <li style="display: none"><a>菜单子项 </a></li>
                           </ul>
                        </li>
                    </ul>
                </div>

    $(".nav-header").toggle(
    function (event) {
    if($(event.target).is("a")){
    return;
    }

    event.stopPropagation();
    $(this).find("ul:first").show();
    $(this).find("i:first").removeClass("icon-touch-folder-right-sign").addClass("icon-touch-folder-right");
    $(this).siblings().show();
    },
    function (event) {

    if($(event.target).is("a")){
    return;
    }
    event.stopPropagation();
    $(this).find("ul:first").hide();
    $(this).find("i:first").removeClass("icon-touch-folder-right").addClass("icon-touch-folder-right-sign");
    $(this).siblings().hide();
    })

  • 相关阅读:
    VMware Workstation-虚拟机的安装
    Linux操作系统-命令-free
    Linux操作系统-命令-vmstat
    抛出一个异常
    字符集
    页面缓存
    表单域
    弹出式说明
    canselBubble 和 stopPropagation理解
    JS---递归函数理解
  • 原文地址:https://www.cnblogs.com/lyd96321/p/5830132.html
Copyright © 2011-2022 走看看