title: collapsed menu - hide other submenu
body: <p>I want to a create collapsed navbar. I have problem that I have errors when I try hide expanded items. It's for cms and I cannot use ids, I have to close it by class.
  I had the idea to close it during <code>show</code> event, but it throws an error.</p>
  
  <p>I have tried something like this:</p>
  
  <pre><code>    $(document).ready(function(){
          $(".collapse").on('show.bs.collapse', function(e){
              $(".collapse").collapse("hide");
          });
      });
  </code></pre>
  
  <p>but I have the error: </p>
  
  <pre><code>Invalid regular expression: /(^|\.)bs\.(?:.*\.|)collapse(\.|$)
  </code></pre>
  
  <p>I need it to work similar to a dropdown menu, if you click on one, it will be open, if click on another, then first is hidden and only 1 is active in one time.</p>
  
  <p>HTML:</p>
  
  <pre><code>`&lt;div class="nav navbar-nav"&gt;
      &lt;ul&gt;
      &lt;li&gt;
   &lt;a data-toggle="collapse" data-target="Divs ids" class="collapsed"&gt;name&lt;/a&gt;
      &lt;/li&gt;
  &lt;/ul&gt;`
  
  
  `&lt;div id="subcategories"&gt;
      &lt;div id="20" class="collapse" &gt;.... &lt;/div&gt;
      &lt;div id="21" class="collapse" &gt;.... &lt;/div&gt;
      &lt;div id="22" class="collapse" &gt;.... &lt;/div&gt;
  &lt;/div&gt;`
  </code></pre>
  
  <p>edit:
  i resovled my problem
  another selector in method works perfectly</p>
  
  <pre><code>    $(document).ready(function(){
          $(".collapse").on('show.bs.collapse', function(e){
              $(".collapse[aria-expanded='true']").collapse("hide");
          });
      });
  </code></pre>