Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all, any help for a new guy, can't figure this one out. This is my collapsable navbar html and for some reason I can't get the menu to open once it is brought down to mobile size. It does adjust to the "hamburger" style menu but will not open. Thank you all!

HTML
<!-- Navbar	 -->

<div class="navbar-wrapper">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>	
<span class="icon-bar"></span>	
<span class="icon-bar"></span>	
</button>

<a class="navbar-brand" href="/"></a></div><!-- navbar-header	 -->

<div class="collapse navbar-collapse js-navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">My Work</a></li>	
<li><a href="#">Services</a></li>
<li><a href="#">About Me</a></li>
<li><a href="#">Contact</a></li>	
</ul><!-- navbar-right -->		
</div><!-- navbar-collapse -->		
</div><!-- navbar-container	 -->
</div><!-- navbar-fixed	 -->	
</div><!-- navbar-wrapper -->


What I have tried:

I have tried looking online for some help on my own and know I am missing something stupid, like I said I am new to html and still learning, slowly...
Posted
Updated 22-Nov-16 15:08pm
v2

1 solution

just guessing - but onclick maybe (hard to tell if you are using other code/framework to hook into the elements or not)?

for example:

<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse" onclick="alert('hello');return false;">
Toggle navigation



</button>

you'll have to replace alert('hello') with a call to a function to act on your menu...
 
Share this answer
 
Comments
Member 12865224 22-Nov-16 21:16pm    
Thank you, I will give that a shot.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900