Accordion - Don't want to make first cell active

青春壹個敷衍的年華 提交于 2019-12-25 01:05:33

问题


Well I am using jQuery accordion. Below is what I have

$(document).ready(function(){
    $("#accordion001").accordion({
        collapsible: true,
        autoHeight: false,
        navigation: true
    });
});

The problem is that it always shows the first link data by default.

+++++++++++++++++++++++++++++++++++++++
+   Link 1                            +
+     Link 1 line 1                   +
+     Link 1 line 2                   +
+     Link 1 line 3                   +
+   Link 2                            +
+   Link 3                            +
+   Link 4                            +
+++++++++++++++++++++++++++++++++++++++

I don't want to show first link data. I just want to show all available links as below.

+++++++++++++++++++++++++++++++++++++++
+   Link 1                            +
+   Link 2                            +
+   Link 3                            +
+   Link 4                            +
+++++++++++++++++++++++++++++++++++++++

Is it doable? What option do I need to write?


回答1:


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

this should work.




回答2:


$( "#accordion001" ).accordion( "option", "active", 2 );

and it will be opened in load time.



来源:https://stackoverflow.com/questions/12621550/accordion-dont-want-to-make-first-cell-active

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!