Results 1 to 5 of 5

Thread: Glossy Menu Customization Issue

  1. #1
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation Glossy Menu Customization Issue

    1) Script Title: Glossy Menu

    2) Script URL (on DD): [URL="http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-glossy.htm[/URL]

    3) Describe problem: I would like to close headers with submenus when I click one level headers. If I click on The Team it shows sub-options but if I click on Home, sub-options stay open.

    http://www.neophite.com/paulo/tnmicroendo

    Thanks for the help in advance!!!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Instead of relying upon the persiststate: true property to keep an item open when going from page to page, set that to false.

    Instead you can either use the defaultexpanded property and/or the URL parameter method.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you John for the fast response. Could you please elaborate on "defaultexpanded property and/or the URL parameter method"? I changed the persistant state to false, works great, but I would like the submenu to stay open while I'm on a section with sub-options and close that menu when I'm clicking on an one level menu item. Again, thank you!!!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    OK, when you click on an expanded item, you are going to a different page. On that page you may set the default expanded to whatever index is required for example:

    Code:
    ddaccordion.init({
    	headerclass: "submenuheader", //Shared CSS class name of headers group
    	contentclass: "submenu", //Shared CSS class name of contents group
    	revealtype: "click", //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: [0], //index of content(s) open by default [index1, index2, etc] [] denotes no content
    	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
    	animatedefault: false, //Should contents open by default be animated into view?
    	persiststate: false, //persist state of opened contents within browser session?
    	toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    	togglehtml: ["suffix", "<img src='plus.gif' class='statusicon' />", "<img src='minus.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    	animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
    	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
    		//do nothing
    	},
    	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
    		//do nothing
    	}
    })
    Would open the first one. that would be good on bio.html and staff.html

    Or skip that and use the url parameter. Everywhere you have:

    Code:
    <div class="submenu">
    	<ul>
    	<li><a href="bio.html?submenuheader=0">Dr. Sam Alborz</a></li>
    	<li><a href="staff.html?submenuheader=0">The Staff</a></li>
    	</ul>
    </div>
    add the highlighted.

    Whichever method you use the number 0 refers to the the first sub menu. 1 would refer to the second , and so on.

    The url parameter overrides everything, the cookie (if you revert to persistate: true) overrides the defaultexpanded, which is only used if neither of the other two are.

    So you could actually mix and match all three, but I think it's simplest to use only the default exapanded. Your URL's will look cleaner and avoiding cookies is good. Some people disable them, and they can persist in odd ways causing unexpected results sometimes, at least during testing.
    Last edited by jscheuer1; 01-24-2012 at 04:09 PM. Reason: clarity
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    pr75 (01-24-2012)

  6. #5
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Talking

    Thank you John! You really saved the day!Perfect!

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
  •