"accordian"
Bootstrap 3.3.0 Snippet by ashum499

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.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="panel-group" id="accordion"> <div class="panel panel-default col-lg-3 no-padding"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> <i class="more-less glyphicon glyphicon-plus"></i> Body Care</a> </h4> </div> <div id="collapseOne" class="panel-collapse collapse"> <div class="panel-body"> <div class="panel-group accordion2"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent=".accordion2" href="#collapseOne-1"> <i class="more-less glyphicon glyphicon-plus"></i> Food</a> </h4> </div> <div id="collapseOne-1" class="panel-collapse collapse"> <div class="panel-body"> <ul> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> </ul> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent=".accordion2" href="#collapseOne-2"> <i class="more-less glyphicon glyphicon-plus"></i> Nappied</a> </h4> </div> <div id="collapseOne-2" class="panel-collapse collapse"> <div class="panel-body"> <ul> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> </ul> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent=".accordion2" href="#collapseOne-3"> <i class="more-less glyphicon glyphicon-plus"></i> Toiletries</a> </h4> </div> <div id="collapseOne-3" class="panel-collapse collapse"> <div class="panel-body"> <ul> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> </ul> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent=".accordion2" href="#collapseOne-4"> <i class="more-less glyphicon glyphicon-plus"></i> Accessories</a> </h4> </div> <div id="collapseOne-4" class="panel-collapse collapse"> <div class="panel-body"> <ul> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="panel panel-default col-lg-3 no-padding"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo"> <i class="more-less glyphicon glyphicon-plus"></i> Personal Care</a> </h4> </div> <div id="collapseTwo" class="panel-collapse collapse"> <div class="panel-body"> <div class="panel-group accordion2"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent=".accordion2" href="#collapseTwo-5"> <i class="more-less glyphicon glyphicon-plus"></i> Food</a> </h4> </div> <div id="collapseTwo-5" class="panel-collapse collapse"> <div class="panel-body"> <ul> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> </ul> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent=".accordion2" href="#collapseTwo-6"> <i class="more-less glyphicon glyphicon-plus"></i> Nappied</a> </h4> </div> <div id="collapseTwo-6" class="panel-collapse collapse"> <div class="panel-body"> <ul> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> </ul> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent=".accordion2" href="#collapseTwo-7"> <i class="more-less glyphicon glyphicon-plus"></i> Toiletries</a> </h4> </div> <div id="collapseTwo-7" class="panel-collapse collapse"> <div class="panel-body"> <ul> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> </ul> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent=".accordion2" href="#collapseTwo-8"> <i class="more-less glyphicon glyphicon-plus"></i> Accessories</a> </h4> </div> <div id="collapseTwo-8" class="panel-collapse collapse"> <div class="panel-body"> <ul> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> <li><a href="">link</a></li> </ul> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div>
.panel-group .panel + .panel { margin-top: 0px; }
$(document).ready(function(){ function toggleIcon(e) { $(e.target) .prev('.panel-heading') .find(".more-less") .toggleClass('glyphicon-plus glyphicon-minus'); } $('.panel-group').on('hidden.bs.collapse', toggleIcon); $('.panel-group').on('shown.bs.collapse', toggleIcon); $('.accordion2').on('hidden.bs.collapse', toggleIcon); $('.accordion2').on('shown.bs.collapse', toggleIcon); });

Related: See More


Questions / Comments: