In Twitter Bootstrap, I am trying to create a button dropdown with an accordion inside it.
the purpose is to present a long list of items in a concise form (i.e. avoid long scroll-downs by the user).
the straightforward way of including an accordion div inside a dropdown div does not work..:
<div class="dropdown">
<a data-toggle="dropdown" href="#">Dropdown trigger</a>
<div class="dropdown-menu" role="menu" aria-labelledby="dLabel" id="accordion">
<h3>Unit 1</h3>
<div>
<p>item a</p>
<p>item b</p>
</div>
<h3>Unit 2</h3>
<div>
<p>item c</p>
<p>item d</p>
<p>item e</p>
</div>
</div>
</div>
Any ideas how can one implement this?
You can insert an accordion inside a dropdown using :
You'll need to add a few lines of JS to prevent Dropdown events to break Collapse ones.
Working example on Bootply