Pages

Thursday, March 12, 2015

deepstutorials: Bootstrap expand/Collapse Plugin



Bootstrap plugin is  used to create expandable/collapsible Panels.Below is the code

<div class="panel-group" id="accordion">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h4 class="panel-title">
        <a data-toggle="collapse" data-parent="#accordion" 
          href="#collapse1">
         Section 1 Content.Click me to expand.Click again to collapse
        </a>
      </h4>
    </div>
    <div id="collapse1" class="panel-collapse collapse in">
      <div class="panel-body">
      Section 1 Content.Click me to expand.Click again to collapse.
      </div>
    </div>
  </div>
  <div class="panel panel-default">
    <div class="panel-heading">
      <h4 class="panel-title">
        <a data-toggle="collapse" data-parent="#accordion" 
          href="#collapse2">
      Section 2 Content.Click me to expand.Click again to collapse.
      
        </a>
      </h4>
    </div>
    <div id="collapse2" class="panel-collapse collapse">
      <div class="panel-body">
       Section 2 Content.Click me to expand.Click again to collapse.
      
      </div>
    </div>
  </div>
  <div class="panel panel-default">
    <div class="panel-heading">
      <h4 class="panel-title">
        <a data-toggle="collapse" data-parent="#accordion" 
          href="#collapse3">
               Section 3 Content.Click me to expand.Click again to collapse.
         </a>
      </h4>
    </div>
    <div id="collapse3" class="panel-collapse collapse">
      <div class="panel-body">
        Section 3 Content.Click me to expand.Click again to collapse.
       </div>
    </div>
  </div>
</div>
 Section 1 Content.Click me to expand.Click again to collapse        
      
Section 1 Content .Click me to expand.Click again to collapse.
Section 2 Content.Click me to expand.Click again to collapse.
Section 3 Content.Click me to expand.Click again to collapse.