PDA

View Full Version : Accordion Menu: Can't go back to header page after expanding submenu



Crawfish5000
07-29-2010, 03:56 PM
1) Script Title: Glossy Accordion Menu

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

3) Describe problem:

I have the script implemented with my own CSS. It works great, except for one issue I can't seem to find a setting for:

I have my headers set to "clickgo" since they are links. They expand as expected. Once expanded, if I go to a subitem, and while on the page for a subitem, I then click on the header, I am not returned to the header page. Instead, the header collapses, and then I have to click it again to go to the header page. Is this the expected behavior? Or is there a setting I can modify to do what I described?

From a usability perspective, I'd expect to be able to go back to the main header section without having to first close the whole submenu and then click the header.

Any help would be appreciated. This site is terrific and extremely helpful!

-K

ddadmin
07-30-2010, 07:04 AM
This is by design actually. I assumed that the unitive thing to do is only to go to the URL when the user wants to see more, by expanding a sub menu. Collapsing usually means he wants to see less.

In any event, to have the goto behavior present both when expanding and collapsing a sub menu, try the below modified .js file.

Crawfish5000
07-30-2010, 01:28 PM
This is by design actually. I assumed that the unitive thing to do is only to go to the URL when the user wants to see more, by expanding a sub menu. Collapsing usually means he wants to see less.

In any event, to have the goto behavior present both when expanding and collapsing a sub menu, try the below modified .js file.

Thanks so much, I'll try this and report back.

-Kevin

Crawfish5000
08-02-2010, 12:50 PM
This works great! Thank you.

I'm trying to add some code to this application to highlight the current subitem. I have some js from another app that does highlight the subitems and am trying to marry the two. However, I am only semi-literate with js and am at a loss. Can anyone help?

Thanks
-Kevin

ddadmin
08-03-2010, 12:14 AM
It really depends on finding some way on your own of matching the current page with the sub menu that is supposed to be open, then either setting the "defaultexpanded" parameter of your menu, or calling one of the Accordion Menu expand/contract methods (http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment.htm), to expand that sub menu. Typically this means you have some server side code that reliably determines as each page loads which sub menu within Accordion Menu should be open, then taking advantage of one of the two aforementioned methods of the script to actually realize it.