PDA

View Full Version : Accordion Content script problem



sassenach
01-19-2010, 12:12 PM
1) Script Title: Accordion Content script (v1.7.1)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-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

jscheuer1
01-20-2010, 01:30 AM
You have (as far as I can tell):


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:


defaultexpanded: [0, 1], //index of content(s) open by default [index1, index2, etc] [] denotes no content

If you add another (a third one):


defaultexpanded: [0, 1, 2], //index of content(s) open by default [index1, index2, etc] [] denotes no content

I think you see the pattern.

sassenach
01-20-2010, 08:20 AM
hi. i added that [0, 1], but still doesn't open them both. please have a look at the site.
am i missing something?

jscheuer1
01-20-2010, 08:40 AM
Works here after clearing the cache and disabling cookies. Remember, you also have:


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.

sassenach
01-20-2010, 11:50 AM
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.

jscheuer1
01-20-2010, 03:30 PM
I can't say what correctly is, as far as how you want it to look goes. Play around with it. I tried:


.product_menu .headerbar2 span {padding-left: 0.5em;}

That seemed OK.