Anna Jeanine Anna Jeanine - 1 month ago 9
CSS Question

"dropdown-toggle" down on default

I am using bootstrap to have a side navigation bar in mijn application. I would like the dropdown menu's to be open by default, but I can't work it out...

My code:

<nav class="navbar navbar-default sidebar" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-sidebar-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="bs-sidebar-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="{{ url('/') }}">Home of {{ Auth::user()->name }}<span style="font-size:16px;"></span></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Input <span class="caret"></span><span style="font-size:16px;"></span></a>
<ul class="dropdown-menu forAnimate" role="menu">
<li><a href="{{ url('/dashboard/input') }}">Form</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" >Results <span class="caret"></span><span style="font-size:16px;"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ url('/dashboard/result/overview') }}">Results</a></li>

</ul>
</li>

<li><a href="{{ url('/') }}">Tools<span></span></a></li>

<li><a href="{{ url('/documentation') }}">Documentation<span></span></a></li>
@endif
</ul>
</div>
</div>
</nav>

Answer

Try to change

<li class="dropdown">

to

<li class="dropdown open">