Reputation: 5785
Lets say you have 5 "accordions" (i.e. 5 expandible/collapsible sections). Is it possible to preset one of these sections to be expanded when the page is loaded?
Upvotes: 3
Views: 1938
Reputation: 2088
Needs collapsible: true.
Code examples Initialize a accordion with the active option specified.
$( ".selector" ).accordion({ active: 2 });
Get or set the active option, after init. //getter
var active = $( ".selector" ).accordion( "option", "active" );
//setter
$( ".selector" ).accordion( "option", "active", 2 );
I hope that helps. You may check out http://jqueryui.com/demos/accordion/
Upvotes: 4
Reputation: 1035
yes there is active property to determine the default expanded section
you can see it here active
Upvotes: 1