1) Script Title: Bullet List Accordion Menu

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex...enu-bullet.htm

3) Describe problem: I want to be able to have expandable and unexpandable items in the list with similar behaviors.

Those behaviors being

1. When I click the button with out subitems - I want the rest of the items on the page to collapse. I tried this code. The items collapse but I don't go to my href. Without the onclick I go to my href but the last expandable item on the page stays open.

<div class="menuheader"><a href="charity_home.html" onClick="ddaccordion.collapseall('expandable'); return false;" >Charity Events</a></div>

2. I would like the header to appear selected as the expandable items do.

When I use just a normal <div> no class - it has no styling at all

(Below is code - it's very similar to the one for an example from your site)


<script type="text/javascript">
ddaccordion.init({
headerclass: "expandable", //Shared CSS class name of headers group that are expandable
contentclass: "categoryitems", //Shared CSS class name of contents group
revealtype: "clickgo", //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: true, //persist state of opened contents within browser session?
toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["prefix", "", ""], //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
}
})
</script>

STYLES

.arrowlistmenu{
width: 145px; /*width of accordion menu*/
}

.arrowlistmenu .menuheader{ /*CSS class for menu headers in general (expanding or not!)*/
font: bold 11px Arial;
color: white;
background: transparent url(../images/titlebar.png) repeat-x center left;
margin-bottom: 10px; /*bottom spacing between header and rest of content*/
text-transform: uppercase;
padding: 4px 0 4px 10px; /*header text is indented 10px*/
cursor: hand;
cursor: pointer;
}

.arrowlistmenu div a{ /*header bar links*/
font: bold 11px Arial;
color: white;
background: transparent url(../images/titlebar.png) repeat-x center left;
margin-bottom: 10px; /*bottom spacing between header and rest of content*/
text-transform: uppercase;
padding: 4px 0 4px 10px; /*header text is indented 10px*/
cursor: hand;
cursor: pointer;
text-decoration: none;
}


.arrowlistmenu .openheader{ /*CSS class to apply to expandable header when it's expanded*/
background: transparent url(../images/titlebar-active.png) repeat-x center left;
color: #74501F;
}
.arrowlistmenu .openheader a{ /*CSS class to apply to expandable header when it's expanded*/
background: transparent url(../images/titlebar-active.png) repeat-x center left;
color: #74501F;
}

HTML

<div class="menuheader expandable"><a href="golf_home.html">Golf Events</a></div>
<ul class="categoryitems">
<li><a href="golf_home.html" >Large Events</a></li>
<li><a href="golf_small.html">Small Events</a></li>
</ul>

<div class="menuheader"><a href="charity_home.html">Charity Events</a></div>