Results 1 to 3 of 3

Thread: Urban Gray Accordion Menu - no children ruining functionality

  1. #1
    Join Date
    Jul 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Urban Gray Accordion Menu - no children ruining functionality

    1) Script Title: Urban Gray Accordion Menu

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

    3) Describe problem:

    I'm working off of the Urban Gray Accordion Scrip, some pages have sub pages (about, approach, our work) and some do not. If the user is on a page that there is no sub menu, I don't want another sub menu to show either (This is the current case).

    The site: http://thegoodgirlsnyc.com/test/new/index3_7.php

    I changed the settings so the:
    defaultexpanded value is now 4, so it is placed on a value that does not have any children, and persiststate: false

    defaultexpanded: [4], //index of content(s) open by default [index1, index2, etc] [] denotes no content
    persiststate: false, //persist state of opened contents within browser session?

    Now, my pages do not open the child categories when the user is on the page where the navigation should be expanded. What other perimeters could be changed?

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

    Default

    The easiest approach in your case is actually just to manually edit the initialization code of Accordion menu on those pages that you want a sub menu to be expanded by default, by modifying the defaultexpanded option. So on http://thegoodgirlsnyc.com/test/new/approach.php for example, you might modify the initialization code with the change in red:

    Code:
    ddaccordion.init({
    	headerclass: "headerbar", //Shared CSS class name of headers group
    	contentclass: "submenu", //Shared CSS class name of contents group
    	revealtype: "mouseover", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
    	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
    	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
    	defaultexpanded: [1], //index of content(s) open by default [index1, index2, etc] [] denotes no content
    "
    "
    1 here would expand the second menu header relative to the other accordion menu headers on the page, which is what you want here.
    DD Admin

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

    Default

    Thank you for your response, but I am using a php include to have the navigation load on all of the pages, so, one script applies to all of the pages. Is this possible using type of dynamic functionality?

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
  •