title: Bootstrap 3 Hide Dropdown Menu on Menu Item Click
body: <p><a href="http://jsfiddle.net/fw7vh/2/"><strong>Check out the fiddle</strong></a>. I have a basic Bootstrap 3 responsive nav like so:</p>
  
  <pre><code>    &lt;div id="navbar" class="navbar navbar-fixed-top navbar-inverse"&gt;
          &lt;div class="container"&gt;
              &lt;a id="navbar-toggle" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse"&gt;
                  &lt;span class="icon-bar"&gt;&lt;/span&gt;
                  &lt;span class="icon-bar"&gt;&lt;/span&gt;
                  &lt;span class="icon-bar"&gt;&lt;/span&gt;
              &lt;/a&gt;
  
              &lt;a class="navbar-brand" href="#"&gt;Title Title Title&lt;/a&gt;
  
              &lt;div id="nav-collapse" class="nav-collapse collapse"&gt;
                  &lt;ul class="nav navbar-nav"&gt;
                      &lt;li&gt;&lt;a href="#option1"&gt;Option 1&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="#option2"&gt;Option 2&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="#option3"&gt;Option 3&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>The nav items link to sections on the page, rather than different pages so I need the dropdown to hide on click.</p>
  
  <p>Whenever I try to toggle the dropdown manually with jQuery, it messes up future functionality of the dropdown toggle button:</p>
  
  <pre><code>$("#navbar li a").click(function(event) {
      // check if window is small enough so dropdown is created
      $("#navbar-toggle").is(":visible")
          $("#nav-collapse").toggle();
  });
  </code></pre>
  
  <p>Is there a better fix for this?</p>