View Full Version : Glossy Accordion - Setting a submenu item active

06-16-2009, 09:44 PM
1) Script Title: Glossy Accordion Menu

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

3) Describe problem:

and thanks for a grat page!
I found info on setting an "active" class on the header when the user expands it, but what about when the user clicks on a submenu <li> under the header?

1) Is there an easy way of setting a class for the submenu item clicked?

2) If the user gets to that page without clicking the submenu item, how can I automatically expand the parent header and highlight (set a class) on the corresponding submenu item, without using a query param?

All comments much appreciated!


06-17-2009, 05:31 AM
A sub menu link is technically just some arbitrary content, so the script by default has no way of highlighting it based on some condition. You can, however, utilize the onunit() and onopenclose() events (http://dynamicdrive.com/dynamicindex17/ddaccordion_suppliment2.htm) to compare the current page's URL to those of your sub menu links, and if a match is found, do something such as highlight it. The exact code however depends on the format of your URL and sub menu links as well.

06-17-2009, 06:26 AM
OK, thanks.
I'll try the URL comparison.