Accordion:如何在扩展另一个时保持当前标签的扩展?

时间:2016-08-22 07:01:08

标签: jquery angularjs html5

我有这样的手风琴:

<div class="div_accordion">
    <accordion class="my_accordion">
        <accordion-group is-open="value1.open">
          <accordion-heading>Heading 1</accordion-heading>
          <p> Para 1</p>
        </accordion-group>

        <accordion-group is-open="value2.open">
          <accordion-heading>Heading 2</accordion-heading>
          <p> Para 2</p>
        </accordion-group>

        <accordion-group is-open="value3.open">
          <accordion-heading>Heading 3</accordion-heading>
          <p> Para 3</p>
        </accordion-group>
    </accordion>
</div>

打开另一个时,会关闭当前打开的标签。

我想在打开其他标签时保持当前标签打开。

使用accordion如何在angular / jquery中执行此操作?

1 个答案:

答案 0 :(得分:1)

这将解决您的问题。

<div class="div_accordion">
    <accordion class="my_accordion" close-others="false">
        <accordion-group is-open="value1.open">
          <accordion-heading>Heading 1</accordion-heading>
          <p> Para 1</p>
        </accordion-group>

        <accordion-group is-open="value2.open">
          <accordion-heading>Heading 2</accordion-heading>
          <p> Para 2</p>
        </accordion-group>

        <accordion-group is-open="value3.open">
          <accordion-heading>Heading 3</accordion-heading>
          <p> Para 3</p>
        </accordion-group>
    </accordion>
</div>