如何在jquery ui [duplicate]中关闭accordion函数的第一行

时间:2022-12-01 15:02:37

This question already has an answer here:

这个问题在这里已有答案:

I want to do is close the first row just like the others in the second row and etc. My problem is the first row always open every time users refresh the page or not.

我想做的就是关闭第一行,就像第二行中的其他行一样等等。我的问题是每次用户刷新页面时第一行总是打开。

i want it like this 如何在jquery ui [duplicate]中关闭accordion函数的第一行

我想要这样

  $(function() {
    $( "#accordion" ).accordion();
  });

http://jsfiddle.net/Mp64t/57/

http://jsfiddle.net/Mp64t/57/

2 个解决方案

#1


1  

Demo

演示

Try active and collapsible properties,

尝试活动和可折叠属性,

$(function() {
    $( "#accordion" ).accordion({active:false,collapsible:true});
});

In the version you are using, just active:true won't affect the accordion if you don't set collapsible property.

在您使用的版本中,只有active:true如果您没有设置collapsible属性,则不会影响手风琴。

By default, Panels are set to collapsible:false

默认情况下,Panels设置为collapsible:false

#2


3  

Just add active option:

只需添加活动选项:

$(function() {
      $( "#accordion" ).accordion({
          active: false
      });
  });

#1


1  

Demo

演示

Try active and collapsible properties,

尝试活动和可折叠属性,

$(function() {
    $( "#accordion" ).accordion({active:false,collapsible:true});
});

In the version you are using, just active:true won't affect the accordion if you don't set collapsible property.

在您使用的版本中,只有active:true如果您没有设置collapsible属性,则不会影响手风琴。

By default, Panels are set to collapsible:false

默认情况下,Panels设置为collapsible:false

#2


3  

Just add active option:

只需添加活动选项:

$(function() {
      $( "#accordion" ).accordion({
          active: false
      });
  });