I may be missing something obvious here but your href needs an actual link not the default # ie
Code:<li><a href="some_actual_page.html">Category 1-1</a></li>
Hi guys
in the example below it is not possible to go to catalog.html link.
Is there a way to make this link accessible for navigation?
I want to make following:
- clicking on catalog link routes to catalog.html
- clicking on <span class="caret"> next to catalog link opens dropdown (or hower on li class="dropdown")
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="catalog.html">Catalog <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Category 1-1</a></li>
<li><a href="#">Category 1-2</a></li>
<li><a href="#">Category 1-3</a></li>
</ul>
</li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>
</div>
</div>
</nav>
I may be missing something obvious here but your href needs an actual link not the default # ie
Code:<li><a href="some_actual_page.html">Category 1-1</a></li>
My Codeivate ProfileDon't believe everything you read on the internet - Albert Einstein
if you read my post attentively you will see the real link <a class="dropdown-toggle" data-toggle="dropdown" href="catalog.html">Catalog <span class="caret"></span></a>
I am blind so not using CODE tags to wrap your code in doesnt help at all it formats terribly, but I think the short answer is no, there is not a way to do this. Once you place the data-toggle="dropdown" the jquery disables using the href as a link. I could be wrong but I have never used it in this way. Making it a dropdown + actual link will effect your user experience in a bad way, when people see a dropdown caret they usually assume it is a dropdown link not another page + dropdown
My Codeivate ProfileDon't believe everything you read on the internet - Albert Einstein