I've been searching high and low for an example that matches my current issue, but so far, no luck. I'm attempting to design a collapsible side navigation with multiple levels in bootstrap using bootstrap.js.
The problem I'm facing is that I have successfully added a second level, but when I click on a list item to expand it, the entire menu collapses. Furthermore, when I reopen the menu, the second-level menu remains open as well. Here is a snippet of my code:
<div class="sidebar-nav">
<p class="sidenav-header">Units and Lessons:</p>
<ul class="nav nav-list">
<li class="nav-header" data-toggle="collapse" data-target="#content-areas"> <span class="nav-header-primary">
Content Areas
</span>
<ul class="nav nav-list collapse" id="content-areas">
<li><a href="#" title="Title">All</a></li>
<li><a href="#" title="Title">Urban Planning</a></li>
<li><a href="#" title="Title">Sustainability</a></li>
<li><a href="#" title="Title">Public Administration</a></li>
<li data-toggle="collapse" data-target="#nav-health" data-parent="#content-areas"><a href="#" title="Title">Health</a>
<ul class="nav-secondary nav-list collapse" id="nav-health">
<li><a href="#" title="Title">Introduction</a></li>
<li><a href="#" title="Title">Lesson: What is Epilepsy?</a></li>
<li><a href="#" title="Title">Lesson: Pathology</a></li>
</ul>
</li>
</ul>
</li>
<li class="nav-header" data-toggle="collapse" data-target="#languages"> <span class="nav-header-primary">
Languages
</span>
<ul class="nav nav-list collapse" id="languages">
<li><a href="#" title="Title">All</a></li>
<li><a href="#" title="Title">Arabic</a></li>
<li><a href="#" title="Title">Turkish</a></li>
<li><a href="#" title="Title">Hebrew</a></li>
</ul>
</li>
</ul>
</div>
The issue specifically arises under the "Health" list item within the "Content Areas" section.
Any assistance would be greatly appreciated. Thank you!