Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Tabs with accordion approach(Includes nested items)"
Bootstrap 3.3.0 Snippet by
BpDemo
3.3.0
jQuery
tabs
accordion
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
55.9K
 
22 Fav
Post to Facebook
Tweet this
<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="col-md-6 col-md-offset-3"> <!-- Nav tabs category --> <ul class="nav nav-tabs faq-cat-tabs"> <li class="active"><a href="#faq-cat-1" data-toggle="tab"><i class="glyphicon glyphicon-user"></i>Respiratory</a></li> <li><a href="#faq-cat-2" data-toggle="tab"><i class="glyphicon glyphicon-plus"></i>Eye</a></li> <li><a href="#faq-cat-2" data-toggle="tab"><i class="glyphicon glyphicon-delete"></i>Skin</a></li> <li><a href="#faq-cat-2" data-toggle="tab"><i class="glyphicon glyphicon-leaf"></i>General</a></li> <li><a href="#faq-cat-2" data-toggle="tab"><i class="glyphicon glyphicon-user"></i>CNS</a></li> <li><a href="#faq-cat-2" data-toggle="tab"><i class="glyphicon glyphicon-user"></i>Tab1</a></li> </ul> <!-- Tab panes --> <div class="tab-content faq-cat-content"> <div class="tab-pane active in fade" id="faq-cat-1"> <div class="panel-group" id="accordion-cat-1"> <div class="panel panel-default panel-faq"> <div class="panel-heading"> <a data-toggle="collapse" data-parent="#accordion-cat-1" href="#faq-cat-1-sub-1"> <h4 class="panel-title"> Nested item #1 <span class="pull-right"><i class="glyphicon glyphicon-plus"></i></span> </h4> </a> </div> <div id="faq-cat-1-sub-1" class="panel-collapse collapse"> <div class="panel-body"> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> </div> </div> </div> <div class="panel panel-default panel-faq"> <div class="panel-heading"> <a data-toggle="collapse" data-parent="#accordion-cat-1" href="#faq-cat-1-sub-2"> <h4 class="panel-title"> Nested item #2 <span class="pull-right"><i class="glyphicon glyphicon-plus"></i></span> </h4> </a> </div> <div id="faq-cat-1-sub-2" class="panel-collapse collapse"> <div class="panel-body"> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> </div> </div> </div> </div> </div> <div class="tab-pane fade" id="faq-cat-2"> <div class="panel-group" id="accordion-cat-2"> <div class="panel panel-default panel-faq"> <div class="panel-heading"> <a data-toggle="collapse" data-parent="#accordion-cat-2" href="#faq-cat-2-sub-1"> <h4 class="panel-title"> Nested item 1 <span class="pull-right"><i class="glyphicon glyphicon-plus"></i></span> </h4> </a> </div> <div id="faq-cat-2-sub-1" class="panel-collapse collapse"> <div class="panel-body"> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> </div> </div> </div> <div class="panel panel-default panel-faq"> <div class="panel-heading"> <a data-toggle="collapse" data-parent="#accordion-cat-2" href="#faq-cat-2-sub-2"> <h4 class="panel-title"> Nested item #2 <span class="pull-right"><i class="glyphicon glyphicon-plus"></i></span> </h4> </a> </div> <div id="faq-cat-2-sub-2" class="panel-collapse collapse"> <div class="panel-body"> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> <div class="row form-group"> <div class="col-sm-2">Fever</div> <div class=" col-sm-3 btn-group" data-toggle="buttons"> <label class="btn btn-primary btn-sm active"> <input type="checkbox" autocomplete="off" checked>Yes </label> <label class="btn btn-primary btn-sm"> <input type="checkbox" autocomplete="off">No </label> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div>
body { padding-top: 30px; } .faq-cat-content { margin-top: 25px; } .faq-cat-tabs li a { padding: 15px 10px 15px 10px; background-color: #ffffff; border: 1px solid #dddddd; color: #777777; } .nav-tabs li a:focus, .panel-heading a:focus { outline: none; } .panel-heading a, .panel-heading a:hover, .panel-heading a:focus { text-decoration: none; color: #777777; } .faq-cat-content .panel-heading:hover { background-color: #efefef; } .active-faq { border-left: 5px solid #888888; } .panel-faq .panel-heading .panel-title span { font-size: 13px; font-weight: normal; }
$(document).ready(function() { $('.collapse').on('show.bs.collapse', function() { var id = $(this).attr('id'); $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-faq'); $('a[href="#' + id + '"] .panel-title span').html('<i class="glyphicon glyphicon-minus"></i>'); }); $('.collapse').on('hide.bs.collapse', function() { var id = $(this).attr('id'); $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-faq'); $('a[href="#' + id + '"] .panel-title span').html('<i class="glyphicon glyphicon-plus"></i>'); }); });
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76