0
Given a sidebar
, how do I get the effect of a accordion?
Currently, my sidebar
works almost perfectly. This means that by clicking menus that have submenus, they are expanded. I’m just not getting to make an expandable collection menu (Collapse) when another menu (also expandable) is selected.
Follow my sidebar code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
<li>
<a href="javascript:;" data-toggle="collapse" data-target="#acc-dashboard"><i class="fa fa-window-restore sb-icon text-center"></i><span class="sb-span">Dashboards</span>
<i class="fa fa-fw fa-angle-right pull-right"></i></a>
<ul id="acc-dashboard" class="collapse">
<li class="nav-item-1">
<a href="#"><span class="sb-span">Entregas</span></a>
</li>
<li>
<a href="#"><span class="sb-span">Mesas</span></a>
</li>
</ul>
</li>
<li>
<a href="javascript:;" data-toggle="collapse" data-target="#acc-financeiro"><i class="fa fa-dollar sb-icon text-center"></i><span class="sb-span">Financeiro</span>
<i class="fa fa-fw fa-angle-right pull-right"></i></a>
<ul id="acc-financeiro" class="collapse">
<li>
<a href="#"><span class="sb-span">Contas a receber</span></a>
</li>
<li>
<a href="#"><span class="sb-span">Contas a pagar</span></a>
</li>
</ul>
</li>
</ul>
</div>
View the above example in "Whole Page".
Have you tried using the
dropdown
?– Woss
I’m taking a look at the w3c documentation. I believe the solution to what I need is in the data-Parent. But for now, nothing yet.
– fnx