Bootstrap 3手风琴必须始终打开顶级

时间:2015-06-03 14:37:17

标签: twitter-bootstrap accordion collapse

我希望手风琴的顶级面板始终保持开放状态。当用户单击任何其他面板时,他们必须像往常一样打开和关闭,而不会影响顶层。我的JavaScript技能很生疏,我担心我已经忘记了很多。任何帮助,将不胜感激。谢谢。 Here is a screenshot

        <!-- Accordion -->
    <div class="panel-group  center-accordion-text" id="accordion" role="tablist" aria-multiselectable="true">
      <!-- One -->

      <div class="panel panel-default">
        <div class="panel-heading" role="tab" id="headingOne1">
          <h4 class="panel-title">
            <a data-toggle="collapse"  href="#collapseOne1" aria-expanded="true" aria-controls="collapseOne1">
                <span clas="title-two"style="color:#A5DF00;">Claims Information</span>
            </a>
          </h4>
        </div>
        <div id="collapseOne1" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne1">
          <div class="panel-body">
            <p>The reason we have insurance is to give you peace of mind!<br>
           provides excellent claims service that is friendly , fair, and consistent.<br>
            <strong>In the event of a claim, contact your agent or broker. If after hours, contact the<br>
            24-hour Emergency Service at, which is represented by .<br>
            </strong></p>
          </div>
        </div>
      </div>



      <div class="panel panel-default">
          <div class="panel-heading" role="tab" id="headingOne" style="border-top: 0;">
          <h4 class="panel-title">
            <a data-toggle="collapse" data-toggle="collapse" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
              Property Loss - What to do
            </a>
          </h4>
        </div>
        <div id="collapseOne" class="panel-collapse collapse " role="tabpanel" aria-labelledby="headingOne">
          <div class="panel-body">
            <div class="col-md-6">
                  <p>
                      If you feel you have a possible loss which is covered by your policy the following steps should be taken as soon as possible:
                      <br>
                      <span class="green-text">1</span>.<span class="blue-text">Contact your Agent or Broker.</span>
                        An adjuster will be assigned at the earliest opportunity. A prompt and fair loss adjustment is made easier when the damages are seen before repairs are begun.
                        <br>
                        2.  Assess loss
                        If the loss is due to theft, burglary, robbery, vandalism or malicious acts, you should give immediate notice to the police or other authorities having jurisdiction and then follow step #1.

                  </p> 
              </div>
              <div class="col-md-6">
                  <p>
                      3.    Livestock loss
                    In the case of livestock alleged to have been killed by lightning, artificial electricity, drowning or accidental physical entrapment, follow step #1 and notify your veterinarian before moving the carcass. A veterinarian certificate stating the cause of death will be required in such cases. If the loss is insured by your policy the veterinarian fee will be paid by us.
                    Updating your insurance coverage on a regular basis will help to make any potential losses less of a financial burden. Contact your Agent or Broker if you have any concerns in this regard.


                  </p>
              </div>

          </div>
        </div>
      </div> <!-- end panel one -->
        <!-- Two -->
      <div class="panel panel-default">
        <div class="panel-heading" role="tab" id="headingTwo">
          <h4 class="panel-title">
            <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
              Helping to prevent delays in providing a loss
            </a>
          </h4>
        </div>
        <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
          <div class="panel-body">
            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
          </div>
        </div>
      </div>

        <!-- Three -->
      <div class="panel panel-default">
        <div class="panel-heading" role="tab" id="headingThree">
          <h4 class="panel-title">
            <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
              Automobile loss - What to do
            </a>
          </h4>
        </div>
        <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
          <div class="panel-body">
            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
          </div>
        </div>
      </div>
        <!-- Four -->
        <div class="panel panel-default">
        <div class="panel-heading" role="tab" id="headingFour">
          <h4 class="panel-title">
            <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
              Police Reporting Centre
            </a>
          </h4>
        </div>
        <div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFour">
          <div class="panel-body">
            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
          </div>
        </div>
      </div>
    </div><!-- end accordion -->

1 个答案:

答案 0 :(得分:0)

根据您最终需要的内容,您只需将第一个面板移动到面板组之外,这将禁用它。

<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
     <h4 class="panel-title">
       Collapsible Group Item #1
   </h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
    <div class="panel-body">Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.</div>
</div>

jsfiddle