Answer the question
In order to leave comments, you need to log in
How to make a dropdown menu on click on an icon in Bootstrap?
In the mobile version of Bootstrap, the submenu opens and closes by clicking on the parent.
What needs to be done so that the menu opens on a click on the icon, and the parent element is clickable.
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true" href="parentlink"><span class="caret"></span></a>
<div class="dropdown-menu">
<ul>
<li><a href="link1"></a></li>
<li><a href="link2"></a></li>
<li><a href="link3"></a></li>
</ul>
</div>
</ul>
</div>
Answer the question
In order to leave comments, you need to log in
<ul class="nav navbar-nav">
<li class='fake'><a href='parentlink'>Ссылка</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true" href="parentlink">Ссылка<span class="caret"></span></a>
...
</li>
<li class='fake'><a href='parentlink2'>Ссылка2</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true" href="parentlink2">Ссылка2<span class="caret"></span></a>
...
</li>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question