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

问题描述 投票:0回答:1

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

Collapse current accordion section disabling it and expand next 

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

javascript button accordion collapse expand
1个回答
0
投票

您可以使用<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>
© www.soinside.com 2019 - 2024. All rights reserved.