"Sidebar Menu Group Tree"
Bootstrap 3.0.0 Snippet by xrozix

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <div id="left" class="col-md-6"> <ul id="menu-header-1" class="nav menu"> <li class="item-1 deeper parent active"> <a class="" href="#"> <span data-toggle="collapse" data-parent="#menu-header-1" href="#item-1-menu-1" class="sign"><i class="glyphicon glyphicon-plus"></i></span> <span class="lbl">item-1-menu-1</span> </a> <ul class="children nav-child unstyled small collapse" id="item-1-menu-1"> <li class="item-1-menu-1-item-1 deeper parent active"> <a class="" href="#"> <span data-toggle="collapse" data-parent="#menu-header-1" href="#item-1-menu-1-item-1-menu-1" class="sign"><i class="glyphicon glyphicon-plus"></i></span> <span class="lbl">item-1-menu-1-item-1-menu-1</span> </a> <ul class="children nav-child unstyled small collapse" id="item-1-menu-1-item-1-menu-1"> <li class="item-1-menu-1-item-1-menu-1-item-1 current active"> <a class="" href="#" > <span class="sign"><i class="glyphicon glyphicon-play color-item-1"></i></span> <span class="lbl">item-1-menu-1-item-1-menu-1-item-1</span> (current menu) </a> </li> <li class="item-1-menu-1-item-1-menu-1-item-2"> <a class="" href="#"> <span class="sign"><i class="glyphicon glyphicon-play color-item-1"></i></span> <span class="lbl">item-1-menu-1-item-1-menu-1-item-2</span> </a> </li> </ul> </li> <li class="item-1-menu-1-item-2 deeper parent"> <a class="" href="#"> <span data-toggle="collapse" data-parent="#menu-header-1" href="#item-1-menu-1-item-2-menu-1" class="sign"><i class="glyphicon glyphicon-plus"></i></span> <span class="lbl">item-1-menu-1-item-2-menu-1</span> </a> <ul class="children nav-child unstyled small collapse" id="item-1-menu-1-item-2-menu-1"> <li class="item-1-menu-1-item-2-menu-1-item-1 deeper parent active"> <a class="" href="#"> <span data-toggle="collapse" data-parent="#menu-header-1" href="#item-1-menu-1-item-2-menu-1-item-1-menu-1" class="sign"><i class="glyphicon glyphicon-plus"></i></span> <span class="lbl">item-1-menu-1-item-2-menu-1-item-1-menu-1</span> </a> <ul class="children nav-child unstyled small collapse" id="item-1-menu-1-item-2-menu-1-item-1-menu-1"> <li class="item-1-menu-1-item-2-menu-1-item-1-menu-1-item-1"> <a class="" href="#"> <span class="sign"><i class="glyphicon glyphicon-play color-item-1"></i></span> <span class="lbl">item-1-menu-1-item-2-menu-1-item-1-menu-1-item-1</span> </a> </li> <li class="item-1-menu-1-item-2-menu-1-item-1-menu-1-item-2"> <a class="" href="#"> <span class="sign"><i class="glyphicon glyphicon-play color-item-1"></i></span> <span class="lbl">item-1-menu-1-item-2-menu-1-item-1-menu-1-item-2</span> </a> </li> </ul> </li> </ul> </li> </ul> </li> <li class="item-2 deeper parent"> <a class="" href="#"> <span data-toggle="collapse" data-parent="#menu-header-1" href="#item-2-menu-1" class="sign"><i class="glyphicon glyphicon-plus"></i></span> <span class="lbl">item-2-menu-1</span> </a> <ul class="children nav-child unstyled small collapse" id="item-2-menu-1"> <li class="item-2-menu-1-item-1 deeper parent"> <a class="" href="#"> <span data-toggle="collapse" data-parent="#menu-header-1" href="#item-2-menu-1-item-1-menu-1" class="sign"><i class="glyphicon glyphicon-plus"></i></span> <span class="lbl">item-2-menu-1-item-1-menu-1</span> </a> <ul class="children nav-child unstyled small collapse" id="item-2-menu-1-item-1-menu-1"> <li class="item-2-menu-1-item-1-menu-1-item-1"> <a class="" href="#"> <span class="sign"><i class="glyphicon glyphicon-play color-item-2"></i></span> <span class="lbl">item-2-menu-1-item-1-menu-1-item-1</span> </a> </li> <li class="item-2-menu-1-item-1-menu-1-item-2"> <a class="" href="#"> <span class="sign"><i class="glyphicon glyphicon-play color-item-2"></i></span> <span class="lbl">item-2-menu-1-item-1-menu-1-item-2</span> </a> </li> </ul> </li> <li class="item-2-menu-1-item-2 deeper parent"> <a class="" href="#"> <span data-toggle="collapse" data-parent="#menu-header-1" href="#item-2-menu-1-item-2-menu-1" class="sign"><i class="glyphicon glyphicon-plus"></i></span> <span class="lbl">item-2-menu-1-item-2-menu-1</span> </a> <ul class="children nav-child unstyled small collapse" id="item-2-menu-1-item-2-menu-1"> <li class="item-2-menu-1-item-2-menu-1-item-1"> <a class="" href="#"> <span class="sign"><i class="glyphicon glyphicon-play color-item-2"></i></span> <span class="lbl">item-2-menu-1-item-2-menu-1-item-1</span> </a> </li> <li class="item-2-menu-1-item-2-menu-1-item-2"> <a class="" href="#"> <span class="sign"><i class="glyphicon glyphicon-play color-item-2"></i></span> <span class="lbl">item-2-menu-1-item-2-menu-1-item-2</span> </a> </li> </ul> </li> </ul> </li> </ul> <!-- "menu-header-1 --> </div> <div id="left" class="col-md-3">Content col2 </div> <div id="left" class="col-md-3">content col 3</div> </div> </div>
/* MENU-LEFT -------------------------- */ /* layout */ #left ul.nav { margin-bottom: 2px; font-size: 12px; /* to change font-size, please change instead .lbl */ } #left ul.nav ul, #left ul.nav ul li { list-style: none !important; list-style-type: none !important; margin-top: 1px; margin-bottom: 1px; } #left ul.nav ul { padding-left: 0; width: auto; } #left ul.nav ul.children { padding-left: 12px; width: auto; } #left ul.nav ul.children li { margin-left: 0px; } #left ul.nav li a:hover { text-decoration: none; } #left ul.nav li a:hover .lbl { color: #999 !important; } #left ul.nav li.current > a .lbl { background-color: #999; color: #fff !important; } /* parent item */ #left ul.nav li.parent a { padding: 0px; color: #ccc; } #left ul.nav > li.parent > a { border: solid 1px #999; text-transform: uppercase; } #left ul.nav li.parent a:hover { background-color: #fff; -webkit-box-shadow: inset 0 3px 8px rgba(0,0,0,0.125); -moz-box-shadow: inset 0 3px 8px rgba(0,0,0,0.125); box-shadow: inset 0 3px 8px rgba(0,0,0,0.125); } /* link tag (a)*/ #left ul.nav li.parent ul li a { color: #222; border: none; display: block; padding-left: 5px; } #left ul.nav li.parent ul li a:hover { background-color: #fff; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } /* sign for parent item */ #left ul.nav li .sign { display: inline-block; width: 25px; padding: 5px 8px; background-color: transparent; color: #fff; } #left ul.nav li.parent > a > .sign { margin-left: 0px; background-color: #999; } /* label */ #left ul.nav li .lbl { padding: 5px 12px; display: inline-block; } #left ul.nav li.current > a > .lbl { color: #fff; } #left ul.nav li a .lbl { font-size: 12px; } /* THEMATIQUE ------------------------- */ /* theme 1 */ #left ul.nav > li.item-1.parent > a { border: solid 1px #ff6307; } #left ul.nav > li.item-1.parent > a > .sign, #left ul.nav > li.item-1 li.parent > a > .sign { margin-left: 0px; background-color: #ff6307; } #left ul.nav > li.item-1 .lbl { color: #ff6307; } #left ul.nav > li.item-1 li.current > a .lbl { background-color: #ff6307; color: #fff !important; } .color-item-1 {color: #ff6307;} /* theme 2 */ #left ul.nav > li.item-2.parent > a { border: solid 1px #51c3eb; } #left ul.nav > li.item-2.parent > a > .sign, #left ul.nav > li.item-2 li.parent > a > .sign { margin-left: 0px; background-color: #51c3eb; } #left ul.nav > li.item-2 .lbl { color: #51c3eb; } #left ul.nav > li.item-2 li.current > a .lbl { background-color: #51c3eb; color: #fff !important; } .color-item-2 {color: #51c3eb;} /* theme 3 */ #left ul.nav > li.item-3.parent > a { border: solid 1px #94cf00; } #left ul.nav > li.item-3.parent > a > .sign, #left ul.nav > li.item-3 li.parent > a > .sign { margin-left: 0px; background-color: #94cf00; } #left ul.nav > li.item-3 .lbl { color: #94cf00; } #left ul.nav > li.item-3 li.current > a .lbl { background-color: #94cf00; color: #fff !important; } .color-item-3 {color: #94cf00;} /* theme 4 */ #left ul.nav > li.item-4.parent > a { border: solid 1px #ef409c; } #left ul.nav > li.item-4.parent > a > .sign, #left ul.nav > li.item-4 li.parent > a > .sign { margin-left: 0px; background-color: #ef409c; } #left ul.nav > li.item-4 .lbl { color: #ef409c; } #left ul.nav > li.item-4 li.current > a .lbl { background-color: #ef409c; color: #fff !important; } .color-item-4 {color: #ef409c;}
!function ($) { // Le left-menu sign /* for older jquery version $('#left ul.nav li.parent > a > span.sign').click(function () { $(this).find('i:first').toggleClass("glyphicon glyphiconx-minus"); }); */ $(document).on("click", "#left ul.nav li.parent > a > span.sign", function () { $(this).find('i:first').toggleClass("glyphicon glyphicon-minus"); }); // Open Le current menu //$("#left ul.nav li.parent.active > a > span.sign").find('i:first').addClass("glyphicon glyphicon-minus"); //$("#left ul.nav li.current").parents('ul.children').addClass("in"); }(window.jQuery);

Related: See More


Questions / Comments: