How do I keep jQuery UI Accordion collapsed by default?

Jquery Ui

Jquery Ui Problem Overview


I am working with jQuery UI Accordion and it works great, but I would like to have the accordion stay closed unless it I click on it.

I am using this code right now, which allows be to toggle it closed:

$("#accordion").accordion({ header: "h3", collapsible: true });

Is there a way to have it closed by default unless it is clicked?

Jquery Ui Solutions


Solution 1 - Jquery Ui

Add the active: false option (documentation)..

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionforrestView Question on Stackoverflow
Solution 1 - Jquery UiGabriele PetrioliView Answer on Stackoverflow