twitter bootstrap side navigation menu onclick collapse

I am using twitter bootstrap theme in which i have side menu with submenus with the following code:

<div id="sidebar" class="nav-collapse ">
  <!-- sidebar menu start-->
  <ul class="sidebar-menu" id="nav-accordion">

    <p class="centered">
      <a href="profile.html"><img
                                  src="${pageContext.request.contextPath}/assets/img/ui-sam.jpg"
                                  class="img-circle" width="60"></a>
    </p>
    <h5 class="centered">Sys_Admin</h5>

    <li class="mt"><a class="active"
                      href="${pageContext.request.contextPath}/admin/viewDashboard"> <i
                                                                                        class="fa fa-dashboard"></i> <span>Dashboard</span>
      </a></li>

    <li class="sub-menu"><a href="javascript:;"> <i
                                                    class="fa fa-desktop"></i> <span>Management</span>
      </a>
      <ul class="sub">

        <li><a
               href="${pageContext.request.contextPath}/admin/addClient">Add
          </a></li>
        <li><a
               href="${pageContext.request.contextPath}/admin/addUser">ADD
          Users</a></li>

        <li><a
               href="${pageContext.request.contextPath}/admin/viewClient">Show
          all Clients</a></li>
        <li><a
               href="${pageContext.request.contextPath}/admin/assignCredits">Assign
          Credits</a></li>
      </ul></li>


    <li class="sub-menu"><a href="viewReportsAdmin"> <i
                                                        class="fa fa-cogs"></i> <span>View Client Reports</span>
      </a></li>

    <li class="sub-menu"><a  href="profile">
      <i class="li_settings"></i> <span>Profile</span>
      </a></li>
  </ul>
</div>

When i click on any submenu the active menu gets collapsed.
I want it to remain open and active until i click another option.

Can anyone help me with this


Source: css

Leave a Reply