title: call bootstrap "Collapse navbar" function manually
body: <p>I'm trying to implement responsive collapsing navbar <a href="http://getbootstrap.com/2.3.2/components.html#navbar" rel="nofollow">Bootstrap 2.3.2</a>.When window width is narrow navbar is collapsing and button with class btn-navbar appears. What I want is to have the ability to call this collapsing function manually from JavaScript when a certain action happens.</p>
  
  <p>I cannot understand where in <code>bootstrap.js</code> window resizing is being watched and how the collapse function is called. </p>
  
  <p>Here is a code of my navbar:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="navbar navbar-fixed-top" id="pantry_header"&gt;
  &lt;div class="navbar-inner"&gt;
      &lt;div class="container"&gt;
          &lt;a class="btn btn-navbar" data-toggle="collapse" data-target=".navbar-responsive-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;div class="logo_wrapper"&gt;
              &lt;img src="./../public/img/logo_op.png" width="133px" height="40px"&gt;
          &lt;/div&gt;
          &lt;div class="nav-collapse collapse navbar-responsive-collapse"&gt;
              &lt;ul class="nav pull-right"&gt;
                  &lt;li class="control local"&gt;&lt;a id="link_user_experience"&gt;USER EXPERIENCE&lt;/a&gt;&lt;/li&gt;
                  &lt;li class="control local"&gt;&lt;a id="link_restocking"&gt;RESTOCKING EXPERIENCE&lt;/a&gt;&lt;/li&gt;
                  &lt;li class="control local"&gt;&lt;a id="link_analytics"&gt;ANALYTICS&lt;/a&gt;&lt;/li&gt;
                  &lt;li class="control local"&gt;&lt;a id="link_team" href="company"&gt;COMPANY&lt;/a&gt;&lt;/li&gt;
                  &lt;li class="hide form_wrapper" id="header_form"&gt;
                      &lt;div style="margin-left: 0px;"&gt;&lt;input type="text" placeholder="Name" name="name"/&gt;&lt;/div&gt;
                      &lt;div&gt;&lt;input type="text" placeholder="E-mail" name="email"/&gt;&lt;/div&gt;
                      &lt;div class="button_wrapper"&gt;
                          &lt;div class="green_btn button"&gt;
                              &lt;div class="button_text white_font"&gt;Learn More&lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>What bootstrap function I should call to hide <code>&lt;ul&gt;</code> with class <code>nav</code>, show navigation button, and put navigation link in the dropdown menu?</p>