Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Glossy Accordion Menu

  1. #1
    Join Date
    Oct 2008
    Location
    UK
    Posts
    26
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Glossy Accordion Menu

    1) Script Title: Glossy Accordion Menu

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

    3) Describe problem: I have created a new page on my website (not yet visible through the website) as a test page for the above script - http://littlewigan.pwp.blueyonder.co...rdion_menu.htm. My problem is that when i click on a header with a submenu underneath it doesn't open the link attached to that header.

    For example if you click on 'apartments' it opens up the sub-menu but it doesn't go to the page hyperlinked to 'apartments'

    Regards,
    Adam.

  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

    That's how it's supposed to work.
    - John
    ________________________

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

  3. #3
    Join Date
    Oct 2008
    Location
    UK
    Posts
    26
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    oh right... maybe i've understood this script wrong, i was hoping to use it as a neater left hand nav system than the one i currently use.

    I was wanting it to work like this for example http://www.totesport.com

    Also i was hoping this would solve my issue with when people translate my site into another language the left hand nav woulod translate too.

    If this script is no use for what i am after, is there another more suited for my needs?

  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

    That would mean that you would have to have persistence on and that the menu would have to be on all pages. Once you have that, edit the script here:

    Code:
    $('.'+config["headerclass"]).bind(config.revealtype, function(){
    			if (config.revealtype=="mouseenter"){
    				clearTimeout(config.revealdelay)
    				var headerindex=parseInt($(this).attr("headerindex"))
    				config.revealdelay=setTimeout(function(){ddaccordion.expandone(config["headerclass"], headerindex)}, config.mouseoverdelay || 0)
    			}
    			else{
    				$(this).trigger("evt_accordion")
    				return false //cancel default click behavior
    			}
    		})
    Change it to:

    return true //cancel default click behavior

    Let me know how that works out. I haven't tested it.
    - 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:

    adam2308 (11-11-2008)

  6. #5
    Join Date
    Oct 2008
    Location
    UK
    Posts
    26
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    I've put the menu on each of the pages in the site and change the script as you mentioned.

    This has fixed my original problem, for example clicking on 'Apartments' opens the page hyperlinked to that text and also opens the submenu of different apartments below in the menu.

    However, there still seems to be some issues:

    * If you click home from the home page (not likely, i know), you get a 404 error.
    * Photo Gallery page doesn't have '+' or '-' symbols against headers with sub-menus
    * Clicking a header with no submenu (for example 'home') from contact us page leaves the contact us sub-menu open.

    Have a play around going from page to page using the left hand nav, you may find more issues.

    http://www.bulgaria2rent.com

    Cheers.

  7. #6
    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

    There is no:

    Code:
    http://www.littlewigan.pwp.blueyonder.co.uk/index.htm
    from your source code:

    HTML Code:
    <a class="menuitem" href="index.htm">Home</a>
    That should be:

    Code:
    <a class="menuitem" href="index.html">Home</a>
    However, since that appears to be hard coded and you don't want the page to change when the user is already on the index, it could be:

    HTML Code:
    <a class="menuitem" href="javascript:void(0);">Home</a>
    on index.html. Perhaps even:

    HTML Code:
    <a class="menuitem">Home</a>
    But that will cancel hover effects (if any) for that item in some browsers.

    The problem on the photo gallery page is at least (there could be other issues) a conflict between jQuery and prototype. See:

    http://www.dynamicdrive.com/forums/s...78&postcount=2

    to resolve that.

    With persistence on, you are going to get the expanded sections carried back to pages that have no expansion of their own. To change that, this may work - On those pages with no expansion of their own, just after the config, set the cookie to empty, ex:


    Code:
    <script type="text/javascript">
    
    
    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" 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: [], //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: true, //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
    	}
    })
    ddaccordion.setCookie(config.headerclass, '')
    </script>
    Alternatively, instead of doing that, you could turn persistence off, and use the:

    Code:
    defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
    property on each page to set its expanded state when it loads.
    Last edited by jscheuer1; 11-14-2008 at 05:04 PM. Reason: add info about hover for anchor with no href
    - John
    ________________________

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

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

    adam2308 (11-14-2008)

  9. #7
    Join Date
    Oct 2008
    Location
    UK
    Posts
    26
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    I'm sorry John. What do you mean by persistence?

  10. #8
    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

    The:

    Code:
    persiststate: true, //persist state of opened contents within browser session?
    property. To turn it off, set it to false - then you can use the:

    Code:
    defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
    property to set the expanded menu (if any) for each page. This would be better than relying upon the cookie (persiststate: true), as some browsers will not allow the cookie, others may not react to it as expected.
    - John
    ________________________

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

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

    adam2308 (11-14-2008)

  12. #9
    Join Date
    Oct 2008
    Location
    UK
    Posts
    26
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    thanks john. i've done that too the pages with no sub-menus and they are working fine. I am still having trouble with the pages with sub-menus, the results seem to be very temperamental.

  13. #10
    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

    Turn persistence off on all pages. Use the defaultexpanded property on each page to indicate which item (if any) should be expanded on that page.
    - John
    ________________________

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

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

    adam2308 (11-14-2008)

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
  •