Advanced Search

Results 1 to 3 of 3

Thread: Glossy Accordion - Setting a submenu item active

  1. #1
    Join Date
    Jun 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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:

    Hi,
    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!

    /Claes

  2. #2
    Join Date
    Aug 2004
    Posts
    9,864
    Thanks
    3
    Thanked 960 Times in 949 Posts
    Blog Entries
    15

    Default

    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.
    DD Admin

  3. #3
    Join Date
    Jun 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK, thanks.
    I'll try the URL comparison.

    /Claes

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •