Results 1 to 4 of 4

Thread: Accordian: Want a main menu item with no children, collapse other submenu on click

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

    Default Accordian: Want a main menu item with no children, collapse other submenu on click

    1) Script Title:
    Accordian: Want a main menu item with no children, collapse other submenu on click
    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...daccordion.htm

    3) Describe problem:
    I am trying accordian and I think it is great. I do have one problem. I have a menu where some of the main menu items do not have children. I Know I can add them as static items but .... if one menu item is selected and its submenu is displayed, when a user clicks on a different menu item (that has no children), I want the on-display submenu to collapse and focus to be placed on the newly clicked childless menu item. Make sense? Phew.

    You can see a simple example here http://www.ainsbury.com/accordiantest/

    Any and all advice is appreciated

  2. #2
    Join Date
    Jul 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Self help

    I solved it myself....if you have the same problem, add a little onclick to the non-child-top menu a. Here is an example:


    <a href="#" onclick="ddaccordion.collapseall('submenuheader')">Dashboard</a>

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    I gather you mean, for example, when "menu3" is expanded, you wish clicking on "menu 4" to collapse the former's sub contents? If so, one way to do it is just by calling one of the expand/collapse methods of the script inside the later, ie:

    Code:
    <h3 class="titlenav"><a href="#" class="menuitem" onClick="ddaccordion.collapseall('submenuheader')">Menu 4 - No Children</a></h3>
    DD Admin

  4. #4
    Join Date
    Jul 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks

    Yes you understood my problem and confirm the fix (see self reply). Many thanks....bob

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
  •