Glossy Accordion - Setting a submenu item active
1) Script Title: Glossy Accordion Menu
2) Script URL (on DD): http://dynamicdrive.com/dynamicindex...enu-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!
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 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.
I'll try the URL comparison.