首页 > Web开发 > 详细

jquery tree

时间:2016-09-01 16:07:43      阅读:185      评论:0      收藏:0      [点我收藏+]
   <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

原文:http://www.cnblogs.com/lyd96321/p/5830132.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!