Bootstrap 3 - Toggle - 2 buttons, 2 elements - How to show/hide?
<p>I'm building a layout template for devs to integrate into their AngularJS/Bootstrap application using Bootstrap 3.3.6. This layout features a left side nav contextual menu which slides over the top of the main page content when opened, or optionally can be 'pinned' open, which then pushes main content to the right.</p>

<p>The navigation itself is in the form of an unordered list containing two buttons. The idea is that when a button is clicked, the relevant div for the sub menu contents is toggled to display (using bootstrap 'collapse' and 'in') classes. Any other sub menu content div elements should be set to not display (without the 'in' class).</p>

<p>This is becoming tricky. If you simply click one button or the other exclusively to control it's relevant content element, it works fine, toggling display of the relevant content. However, if you click each button without clicking the same button again to close it's relevant content, the behavior of the content divs is unexpected, where the second nav button clicked overrides the behavior of the first and it's content persists despite clicking the first nav button again.</p>

<p>My expectation is that the menu buttons need to function as true toggles, where only the relevant content is displayed, and all other menu content divs are not displayed.</p>

<p>Below is the markup for the nav and it's relevant content divs:</p>

<pre><code>&lt;div class="filter-bar pull-left"&gt;

    &lt;ul class=""&gt;

        &lt;li&gt;&lt;!-- NAV ITEM 1 --&gt;
            &lt;button type="button" 
            id="left-nav-toggle-menu" 
            class="left-nav-toggle mnc-filter-icn" 
            title="menu"&gt;
                &lt;i class="fa fa-list-ul fa-fw"&gt;&lt;/i&gt;
            &lt;/button&gt;
        &lt;/li&gt;

        &lt;li&gt;&lt;!-- NAV ITEM 2 --&gt;
            &lt;button type="button" 
            id="left-nav-toggle-filters" 
            class="left-nav-toggle mnc-filter-icn" 
            title="filters"&gt;
                &lt;i class="fa fa-filter fa-fw"&gt;&lt;/i&gt;
            &lt;/button&gt;
        &lt;/li&gt;

    &lt;/ul&gt;

&lt;/div&gt;

&lt;div class="collapse push-menu-content"&gt;&lt;!-- NAV ITEM 1 CONTENT --&gt;

    &lt;div class="clearfix"&gt;

        &lt;button type="button" 
        class="close left-nav-pin pull-right" 
        aria-label="Pin"&gt;
            &lt;i class="fa fa-thumb-tack"&gt;&lt;/i&gt;
        &lt;/button&gt;

    &lt;/div&gt;

    &lt;ul&gt;
        &lt;li&gt;Item 01&lt;/li&gt;
        &lt;li&gt;Item 02&lt;/li&gt;
        &lt;li&gt;Item 03&lt;/li&gt;
    &lt;/ul&gt;

&lt;/div&gt;

&lt;div class="collapse push-filter-content"&gt;&lt;!-- NAV ITEM 2 CONTENT --&gt;

    &lt;div class="clearfix"&gt;

        &lt;button type="button" 
        class="close left-nav-pin pull-right" 
        aria-label="Pin"&gt;
            &lt;i class="fa fa-thumb-tack"&gt;&lt;/i&gt;
        &lt;/button&gt;

    &lt;/div&gt;

    &lt;ul&gt;
        &lt;li&gt;Filter 1 Category&lt;/li&gt;
        &lt;li&gt;Filter 2 Category&lt;/li&gt;
        &lt;li&gt;Filter 3 Category&lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>Now the js function to toggle the nav content:</p>

<pre><code>$(document).ready(function(){
    $("button#left-nav-toggle-menu").click(function(){
        $("div.collapse.push-menu-content").toggleClass("in");
    });
    $("button#left-nav-toggle-filters").click(function(){
        $("div.collapse.push-filter-content").toggleClass("in");
    });
});
</code></pre>

<p>I'm not a js or Bootstrap guru for that matter, I simply used the Bootstrap documentation (collapse and toggleClass) to create these functions. I need help from someone who knows Bootstrap in modifying them so that the nav buttons function as true toggles for the content using Bootstrap and jQuery's built in functionality.</p>

<p>Any help is much appreciated!</p>