Skip to content

Instantly share code, notes, and snippets.

@Megafry
Last active September 22, 2016 19:32
Show Gist options
  • Save Megafry/f8b9aab77853d77e8335275b028851b7 to your computer and use it in GitHub Desktop.
Save Megafry/f8b9aab77853d77e8335275b028851b7 to your computer and use it in GitHub Desktop.
Bootstrap 3 - "data-parent" exemple (minimal code)
<!--
http://stackoverflow.com/questions/19425165/bootstrap-3-accordion-button-toggle-data-parent-not-working
There is a "bug" that makes the accordion dependent on the .panel class when using the data-parent attribute. To workaround it, you can wrap each accordion group in a 'panel' div..
-->
<a data-toggle="collapse" data-parent=".accordion19" href="#collapseOne">Item #1</a>
<a data-toggle="collapse" data-parent=".accordion19" href="#collapseTwo">Item #2</a>
<a data-toggle="collapse" data-parent=".accordion19" href="#collapseThree">Item #3</a>
<div class="accordion19">
<div class="panel">
<div id="collapseOne" class="collapse in">
Lorem Ipsum 1
</div>
<div id="collapseTwo" class="collapse">
Lorem Ipsum 2
</div>
</div>
</div>
<div class="accordion19">
<div class="panel">
<div id="collapseThree" class="collapse">
Lorem Ipsum 3
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment