Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collapse all sections in accordion on page load in jQuery Accordion

I am using JQuery Accordion, I want to hide all the sections on page load. Only when user clicks on header that section should open.

like image 899
Vinay Kumar Chella Avatar asked Sep 11 '25 04:09

Vinay Kumar Chella


2 Answers

Use this in your document ready function when initialising the accordion:

$("#someid").accordion({collapsible : true, active : 'none'});
like image 54
Daff Avatar answered Sep 12 '25 22:09

Daff


active : 'none' is an invalid value, it may appear to work on the surface, but will break other aspects of the accordion widget. Use this instead:

$("#someid").accordion({collapsible : true, active : false});
like image 27
IBrewThereforeIAm Avatar answered Sep 12 '25 22:09

IBrewThereforeIAm