Results 1 to 4 of 4

Thread: Glossy Accordion Menu - a couple of issues

  1. #1
    Join Date
    Jul 2008
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Glossy Accordion Menu - a couple of issues

    1) Script Title: Glossy Accordion Menu

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

    3) Describe problem:

    There are two:

    a: A submenu is open and when I click on another header (which is a link without a submenu), it goes to the appropriate page but the submenu remains open. I would like the first submenu to close, especially since it is not appropriate to the current page.

    b: The headers for the submenus should also be links, taking the user to another page. I have links associated with the headers, but at the moment they are ignored when a header is expanded. Is there any way of them to take you to a new page and expand the submenu? I do not want to use iframes.

    Thank you.

  2. #2
    Join Date
    Aug 2004
    Posts
    9,911
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Both a) and b) are expected behavior actually. Regarding:

    a) If you click on a link on the page that is simply a link and not part of an Accordion content headers group, there is no way for that group to be "aware" of that action, and close one of its sub menus accordingly. You'll have to manually tell the script to close all contents within that group when that happens, for example:

    Code:
    <a href="javascript:ddaccordion.collapseall('mygroup')">Arbitirary link</a>
    b) This has been asked many times actually. I've never quite understood why though, since the two actions are conflicting of one another, and shouldn't exist together IMO. Anyhow, you can do this either by specifying that the headers expand/contract on "mouseover", in which the headers automatically work as regular links again, or use the "onopenclose" event handler of the script, as talked about in this thread.

  3. #3
    Join Date
    Jul 2008
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    My knowledge of javascript is very limited so forgive me if my ignorance is frightening.

    Where does the mygroup come in? Should I include the term mygroup anywhere else, in the original ddaccordion.js for example?

    Another thing: if the href in the link is now to act as a javascript command which collapses the submenus, then how is it to act as a link to another page?

    Thank you.

  4. #4
    Join Date
    Aug 2004
    Posts
    9,911
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Well, menu headers are part of the same "group' if they share the same CSS class name as specified in the script's intialization code for that menu:

    Code:
    ddaccordion.init({
    	headerclass: "submenuheader", //Shared CSS class name of headers group
    	contentclass: "submenu", //Shared CSS class name of contents group
    "
    "
    So as mentioned, if you wish an arbitrary link to close all the headers in the above accordion instance, you'd do something like:

    Code:
    <a href="javascript:ddaccordion.collapseall('submenuheader')">Arbitirary link</a>
    Another thing: if the href in the link is now to act as a javascript command which collapses the submenus, then how is it to act as a link to another page?
    That's exactly my point actually on not understanding why people's interest in having a header act both as a sub menu toggler and actual URL. It makes sense if you're using the "mouseover" option so the headers expand the sub menus onmouseover, leaving "onclick" open to navigate to a URL using.

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
  •