2016-08-22 34 views
0

我有一個這樣的手風琴:手風琴:如何在展開另一張時保持當前標籤的展開?

<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> 

打開另一個是關閉當前打開的選項卡時。

我想打開其他時打開當前選項卡。

使用手風琴我怎麼能在angular/jquery中做到這一點?

+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> 
+0

非常好!有效 –