jquery tree

Posted 积硅步

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jquery tree相关的知识,希望对你有一定的参考价值。

   <div class="fl left"  id="nav" style="width: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();
})

以上是关于jquery tree的主要内容,如果未能解决你的问题,请参考以下文章

jQuery

jQuery插件开发:jQuery类方法

XMLHttpRequest、jQuery.ajax、jQuery.post、jQuery.get 有啥区别

Jquery

jquery的基本api

jQuery编程