Accordion - Don't want to make first cell acti

2019-09-07 10:24发布

问题:

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.