title: Bootstrap collapse within a carousel slide - need to close it if slide item is not active
body: <p>I'm using bootstrap 3 carousel to turn items like this one:</p>
  
  <pre><code>&lt;!-- here is an item, which could get as well class "active" --&gt;
  &lt;div class="item"&gt;
    &lt;div class="row"&gt;
       &lt;div class="col-10 col-offset-1 text-center item-ref"&gt;
         &lt;div class="reference"&gt;some text&lt;/div&gt;
  
         &lt;!-- collapsing item here --&gt;
         &lt;a href="#long-2" data-toggle="collapse" class="reference-long arr_down"&gt;&lt;/a&gt;
         &lt;div id="long-2" class="collapse"&gt;some collapsable text&lt;/div&gt;
  
         &lt;div class="osoba"&gt;text&lt;/div&gt;
         &lt;div class="firma"&gt;text&lt;/div&gt;
       &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And I need to solve problem if the <em>div.item</em> has not class <em>active</em> anymore, the eventual <em>class="in"</em> in the <em>div#long-2</em> (or eventually different number here) is turned back to <em>class="collapse"</em>. </p>
  
  <p>I now, that I can probably do that in jquery, but I'm really not good in it all, could anybody help me?</p>