title: Bootstrap: Collapse other sections when one is expanded
body: <p>I am making a Rails app, and am trying to achieve a particular functionality relating to Twitter's Bootstrap <a href="http://twitter.github.com/bootstrap/javascript.html#collapse" rel="noreferrer">collapse</a>. Bear with me as I explain it.</p>
  
  <p>I currently have the following view:</p>
  
  <p><img src="https://i.stack.imgur.com/sRy9E.png" alt="enter image description here"></p>
  
  <p>When each of these buttons is clicked, their data-toggle div is expanded. The view is set-up as follows:</p>
  
  <pre><code>    &lt;button class="btn dropdown" data-toggle="collapse" data-target="#keys"&gt;&lt;i class="icon-chevron-right"&gt;&lt;/i&gt; Keys &lt;span class="badge badge-info pull-right"&gt;&lt;%= @app.keys.count %&gt;&lt;/span&gt;&lt;/button&gt;
      &lt;button class="btn dropdown" data-toggle="collapse" data-target="#attrs"&gt;&lt;i class="icon-chevron-right"&gt;&lt;/i&gt; Attributes&lt;/button&gt;
      &lt;button class="btn dropdown" data-toggle="collapse" data-target="#edit"&gt;&lt;i class="icon-chevron-right"&gt;&lt;/i&gt; Edit Details&lt;/button&gt;
  
      &lt;div class="collapse indent" id="keys"&gt;
          &lt;!--content--&gt;
      &lt;/div&gt;
  
      &lt;div class="collapse indent" id="attrs"&gt;
          &lt;!--content--&gt;
      &lt;/div&gt;
  
      &lt;div class="collapse" id="edit"&gt;
          &lt;!--content--&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I have them set-up like this, because I want the buttons side by side, in a row. If I move the buttons to be right above the view they expand/collapse, then the buttons stack on top of one another.</p>
  
  <p>So, my end goal is to have the three buttons side-by-side and have them collapse and expand their respective sections. The current set-up works, however is a little awkward. For example, if someone expands the keys section and then expands the attributes section, they have to scroll below the keys section.</p>
  
  <p>There are two possible solutions to this problem. One is that pressing one button causes the other 2 to collapse themselves. This would mean that at any given time, only one of these sections is expanded.</p>
  
  <p>The better solution, I think would be to have it so that when keys is expanded, the buttons to the right move down to the bottom of the keys div, and when attributes is expanded, the edit details button moves to the bottom of that div. Is this possible? I have already tried to do it by letting the buttons stack on top of each other and changing their relative locations through css, but that didn't work because when one of the sections was expanded, the other buttons ended up in awkward spots in the middle of the expanded section.</p>
  
  <p>Lastly, I would like to try to do this without the accordion style behavior as mentioned on twitter's bootstrap page, but if someone can convince me from a design standpoint that it is preferable, I would certainly reconsider.</p>