Log in

View Full Version : Accordion script sections stay expanded when on other pages



kanjigirl
09-07-2010, 03:07 PM
1) Script Title: Arrow Slide Menu accordion script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-arrow.htm

3) Describe problem:

When switching between different menu items, the last-clicked expanded one stays open even if on a different page with no expanded section.

I tried changing 'persiststate' to false, that didn't help. Also, if you visit this page you can see that one of the expanded menus is open:

http://www.essentiallybareclinic.com/ContactUs.htm

I see that I can click the expanded header item to close it manually but I want it to close when I move to another page.Please help, this is urgent.

kanjigirl
09-07-2010, 03:47 PM
Followup here - is it possible to put the initialization js in its own file and call it, rather than have it at the top of every page? When I try that, the page shows every menu item expanded.

kanjigirl
09-07-2010, 09:12 PM
Please help?

Is there something I can add to onit to automatically close any expanded menu headers when a user clicks on one of the unexpandable menu headers, without forcing the user to click on the expanded menu header to close it as is the case now?

When a user is on the Contact Us page, they don't need to see the expanded menu for Services. I hope that makes sense.

kanjigirl
09-07-2010, 09:24 PM
I figured out part of it. If I do this with oninit in the settings for the pages where I don't want any expanding menus showing, it works:

oninit:function(headers, expandedindices){
ddaccordion.collapseall('menuheaders');
}

I think that'll do it. I'll post back here once I'm done making this change to other pages and test it.