0

I am new to Bootstrap. I am trying to incorporate navbar in my demo project. "Toggle collapse" appears not working as expected. When I click on "Home" or say "About", nothing happens. Ideally, i would have expected it to collapse(Similar to what happens on click of the Toggle Navigation button). Please suggest.I have looked into similar questions but couldn't resolve my issue.

https://jsfiddle.net/shenoyvnm/s9w8vd7z/

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
   <div class="container">
      <!-- Brand and toggle get grouped for better mobile display -->
      <div class="navbar-header">
         <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
         <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="#"><img src="img/logo.png" height=30 width=41></a>
      </div>
      <!-- Collect the nav links, forms, and other content for toggling -->
      <div id="navbar" class="navbar-collapse collapse">
         <ul class="nav navbar-nav">
         <li class="active"><a href="#/"><span class="glyphicon glyphicon-home"
            aria-hidden="true"></span>Home</a></li>
         <li><a href="#/about"><span class="glyphicon glyphicon-info-sign"></span>About</a></li>
      </div>
   </div>
   <!-- /.container-fluid -->
</nav>
myselfmiqdad
  • 2,518
  • 2
  • 18
  • 33
user3921104
  • 154
  • 13
  • 2
    What you are expecting is not the default behavior. If you need the menu to close whenever a link within it is clicked you'll need to construct that functionality yourself. See http://stackoverflow.com/questions/21203111/bootstrap-3-collapsed-menu-doesnt-close-on-click – vanburen Jan 01 '16 at 01:46
  • Thanks Vanbruen for your quick response.The link helped, but i was under an impression that Bootstrap handles it by default. Anyway, thanks again. – user3921104 Jan 01 '16 at 02:13

0 Answers0