How can I get the accordion widget to be closed when the page loads? This is the code I’m using:
//Accordion
$( ".accordion" ).accordion({
autoHeight: false,
navigation: true,
collapsible: true,
active: false
});
Also, it may be unimportant but the accordion divs are inside dialog divs.
The
activeoption being set tofalseshould (according to the docs) cause the menu to be collapsed on page-load (though it specifically requirescollapsible: true(which you already have).If this isn’t already in a
$(window).load()or$(document).ready()then it needs to be wrapped in one of those; if it is so wrapped then without a demo (perhaps JS Fiddle, or JS Bin?) it’s difficult to suggest what might be happening, or going wrong.Is the remainder of the JavaScript (beyond the call to
.accordion()being executed? If not there might be a JS error, somewhere. It might be worth running it through JS Lint to be sure.