"Two-Level List Group Menu"
Bootstrap 3.1.0 Snippet by polo00

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.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 class="col-sm-3 col-md-3"> <div class="panel-group" id="accordion"> <div class="panel panel-default" id="item1"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" href="#collapse1"> <h3><span class="glyphicon glyphicon-folder-close"></span>Item 1</h3> </a> </h4> </div> <div id="collapse1" class="panel-collapse collapse"> <div class="panel-body"> <ul class="list-group"> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> </ul> </div> </div> </div> <div class="panel panel-default" id="item2"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" href="#collapse2"> <h3><span class="glyphicon glyphicon-folder-close"></span>Item 2</h3> </a> </h4> </div> <div id="collapse2" class="panel-collapse collapse"> <div class="panel-body"> <ul class="list-group"> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> </ul> </div> </div> </div> <div class="panel panel-default" id="item3"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" href="#collapse3"> <h3><span class="glyphicon glyphicon-folder-close"></span>Item 3</h3> </a> </h4> </div> <div id="collapse3" class="panel-collapse collapse"> <div class="panel-body"> <ul class="list-group"> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> </ul> </div> </div> </div> <div class="panel panel-default" id="item4"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" href="#collapse4"> <h3><span class="glyphicon glyphicon-folder-close"></span>Item 4</h3> </a> </h4> </div> <div id="collapse4" class="panel-collapse collapse"> <div class="panel-body"> <ul class="list-group"> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> <li class="list-group-item"> <div class="checkbox"> <label> <input type="checkbox"> Level 2 </label> </div> </li> </ul> </div> </div> </div> </div> </div> <div class="col-sm-9 col-md-9"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Item-based Options</h3> </div> <div class="panel-body"> <p></p> <div class="alert alert-success"><h3>Checkbox items </h3></div> </div> </div> </div> </div> </div>
body{margin:50px;} #accordion .glyphicon { margin-right:10px; } .panel-collapse>.list-group .list-group-item:first-child {border-top-right-radius: 0;border-top-left-radius: 0;} .panel-collapse>.list-group .list-group-item {border-width: 1px 0;} .panel-collapse>.list-group {margin-bottom: 0;} .panel-collapse .list-group-item {border-radius:0;} .panel-collapse .list-group .list-group {margin: 0;margin-top: 10px;} .panel-collapse .list-group-item li.list-group-item {margin: 0 -15px;border-top: 1px solid #ddd;border-bottom: 0;padding-left: 30px;} .panel-collapse .list-group-item li.list-group-item:last-child {padding-bottom: 0;} .panel-collapse div.list-group div.list-group{margin: 0;} .panel-collapse div.list-group .list-group a.list-group-item {border-top: 1px solid #ddd;border-bottom: 0;padding-left: 30px;}
$('.panel').on('shown.bs.collapse', function (e) { $('#'+e.currentTarget.id).find('.glyphicon').removeClass('glyphicon-folder-close').addClass('glyphicon-folder-open'); }); $('.panel').on('hidden.bs.collapse', function (e) { $('#'+e.currentTarget.id).find('.glyphicon').removeClass('glyphicon-folder-open').addClass('glyphicon-folder-close'); });

Related: See More


Questions / Comments: