title: Bootstrap navbar toggle use to add class
body: <p>I use <strong>Bootstrap V3</strong> in <strong>Wordpress</strong>.</p>
  
  <p>What I want to achieve is that when someone clicks the <code>button</code> in the collapsed <code>navbar</code> menu, the <code>div</code> with the class <code>.slider</code> gets a extra class.</p>
  
  <p>This is the <strong>HTML</strong> from the <strong>navbar</strong>:</p>
  
  <pre><code>&lt;nav class="navbar navbar-default navbar-static-top"&gt;
    &lt;div class="container"&gt;
      &lt;div class="navbar-header"&gt;
        &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"&gt;
          &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&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;/button&gt;
      &lt;/div&gt;
      &lt;div class="collapse navbar-collapse" id="navbar"&gt;
        &lt;?php
          wp_nav_menu( array(
              'theme_location'    =&gt; 'navbar-right',
              'depth'             =&gt; 2,
              'menu_class'        =&gt; 'nav navbar-nav navbar-right',
              'fallback_cb'       =&gt; 'wp_bootstrap_navwalker::fallback',
              'walker'            =&gt; new wp_bootstrap_navwalker())
          );
      ?&gt;
      &lt;/div&gt;&lt;!-- /.navbar-collapse --&gt;
    &lt;/div&gt;&lt;!-- /.container --&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p>And this is the <strong>HTML</strong> from the <code>div</code> where I want to add a extra class: </p>
  
  <pre><code>&lt;div class="slider"&gt;
    &lt;div class="container"&gt;
      &lt;div class="row"&gt;
        other elements 
      &lt;/div&gt; &lt;!-- close row --&gt;
    &lt;/div&gt; &lt;!-- close container --&gt;
  &lt;/div&gt; &lt;!-- close slider --&gt;
  </code></pre>
  
  <p>I've tried this with <strong>CSS</strong>:</p>
  
  <pre><code>.navbar-default .navbar-collapse .in ~ .slider{
     margin-top: -246px;
     padding-top: 176px;
  }
  </code></pre>
  
  <p>And this with <strong>jQuery</strong>:</p>
  
  <pre><code>$(function() {                       
    $("#navbar").click(function() {  
      $(".slider").addClass("sliderMove");      
    });
  });
  </code></pre>
  
  <p>The extra class that should be added on <em>slider</em> is:</p>
  
  <pre><code>.sliderMove{
    margin-top: -246px;
    padding-top: 176px;
  }
  </code></pre>
  
  <p>The purpose of this is that the slider that is after/under the <code>navbar</code> stay's under the <code>navbar</code> when it collapsed.</p>