Results 1 to 6 of 6

Thread: Accordion Content script problem

  1. #1
    Join Date
    Feb 2009
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Accordion Content script problem

    1) Script Title: Accordion Content script (v1.7.1)

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

    3) Describe problem:
    • I need the option "defaultexpanded" variable to expand all my menu titles, not just one. how do i do that?
    • how do i add another sub category under "Woman > Leather" for example?


    Live website url where this menu is located is: http:/www.juliamilano.com/index.php

  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

    You have (as far as I can tell):

    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: false, //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: true, //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: ["", "selected"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    	togglehtml: ["", "", ""], //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
    	}
    })
    That will expand the first item (Women). You only have two items at the moment, so to expand them both:

    Code:
    	defaultexpanded: [0, 1], //index of content(s) open by default [index1, index2, etc] [] denotes no content
    If you add another (a third one):

    Code:
    	defaultexpanded: [0, 1, 2], //index of content(s) open by default [index1, index2, etc] [] denotes no content
    I think you see the pattern.
    - John
    ________________________

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

  3. #3
    Join Date
    Feb 2009
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    hi. i added that [0, 1], but still doesn't open them both. please have a look at the site.
    am i missing something?

  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

    Works here after clearing the cache and disabling cookies. Remember, you also have:

    Code:
    persiststate: true
    So, if the last time you left the page only one was open, then it will persist. Change that to false, clear your cache and it should be fine.
    - John
    ________________________

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

  5. #5
    Join Date
    Feb 2009
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    this seems to work.

    now i have added another sub category and things seem to be a bit messy.

    i have the main category, then i have a sub category, then a 2nd sub category.

    how do i indent it correctly?

    please have a look at http://www.juliamilano.com/index.php on the left side where the menu is.

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

    I can't say what correctly is, as far as how you want it to look goes. Play around with it. I tried:

    Code:
    .product_menu .headerbar2 span {padding-left: 0.5em;}
    That seemed OK.
    - John
    ________________________

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

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
  •