Everything works fine, except I would really like to have no menus expanded when the user clicks on the Home menu item and goes to the home page.
The problem occurs since you have persistence enabled on the top level headers, yet the "Home" menu item isn't part of this group. That means clicking on the "Home" item is the same as clicking on any arbitrary link on the page- it doesn't cause the state of the top level headers to change.
The quickest way to "fix" this is to disable persistence on the top level headers in your config code:
Code:
ddaccordion.init({ //top level headers initialization
headerclass: "expandable", //Shared CSS class name of headers group that are expandable
contentclass: "categoryitems", //Shared CSS class name of contents group
collapseprev: false, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
If you need the persistence feature, what you can do instead is add inside the "Home" menu item code to collapse all headers before whisking the user away to the target page:
Code:
<h3><a href="index.php" onClick="ddaccordion.collapseall('expandable')">Home</a></h3>
Either techniques above should work.
Bookmarks