Is there a way to force jQuery UI accordions closed with CSS until the page finishes loading? We’re using it on a content management system, and each page takes a fare amount of time to load. The jQuery doesn’t get triggured until the page is done loading, but which point, all the accordions are already expanded. They close once the page loads, but I feel like it’s confusing to users to see a giant list of stuff come up and then disappear.
Share
There’s an option on the
.accordion({ ... })call itself:The
active: falseoption makes it closed on creation and thecollapsible: trueoption makes it so you can re-close it once you open it.