繁体   English   中英

折叠/展开按钮上的折叠单击

[英]Collapse/Expand Accordion on Button Click

之前我问过这个问题,但我不清楚我的问题,我想在点击按钮时折叠手风琴的一部分,该按钮禁用当前部分并扩展手风琴的下一部分https://jsfiddle.net/ 2L1x9v07 /

Collapse current accordion section disabling it and expand next 

小提琴中手风琴的前两个部分内有一个继续按钮。单击继续后,当前部分折叠,下一部分展开,我该如何实现?

您可以使用<a>标记上使用的相同方法

<div ng-init="accordion=1">
    <h3 class="accordion" ng-class="{active:accordion==1}">
        <a href ng-click="accordion = 1">Section 1</a>
    </h3>
    <p class="accordion-content" ng-show="accordion==1">Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using
  <br/>
 <button type="submit" style="max-width:200px" ng-click="accordion = 2" class="btn btn-primary btn-block pull-right">Continue</button></p>

    <h3 class="accordion" ng-class="{active:accordion==2}">
        <a href ng-click="accordion = 2">Section 2</a>
    </h3>
    <p class="accordion-content" ng-show="accordion==2">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using
  <br/>
 <button type="submit" style="max-width:200px" ng-click="accordion = 3" class="btn btn-primary btn-block pull-right">Continue</button>

  </p>

    <h3 class="accordion" ng-class="{active:accordion==3}">
        <a href ng-click="accordion = 3">Section 3</a>
    </h3>
    <p class="accordion-content" ng-show="accordion==3">There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form</p>
</div>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM