Bootstrap normally closes other collapses when you click on one to open it.
Is there an option or hack to make it keep the collapses open unless explicitly closed without changing the look and layout of the panel-group?
Update 2020
Bootstrap 4
How do you make Twitter Bootstrap Accordion keep one group open?
Bootstrap 3
You can just remove the data-parent
attribute that is normally used in the accordion markup.
<div class="panel-group" id="accordion"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a class="accordion-toggle" data-toggle="collapse" href="#collapseOne"> Collapsible Group Item #1 </a> </h4> </div> ...
http://bootply.com/127843
See this demo: http://plnkr.co/edit/OxbVII?p=preview
Idea:
Just add data-toggle="collapse"
and a data-target
to element, to automatically assign control of a collapsible element. The data-target
attribute accepts a CSS selector to apply the collapse
to. Be sure to add the class collapse
to the collapsible element. If you'd like it to default open, add the additional class in
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With