View Full Version : Accordian Menu Script

04-14-2009, 09:43 AM

I have used this accordian script and works perfect, only 2 small problems

1: When I load the page, the 1st menu stays open, I have to physically click on "the collection"(check attachment) to close it,how can i get it ,when i open the page it stays closed and only when i click on the menu, it opens,

2: If you look at the attachment again, I want to be able to expand the drop downs aswell, so you click on the collection, it slides down, and then if i click on africa, that slides down again for another option, hope that makes sense???

I have done everything it says in the "how to page" and have not changed any code


Please can you help!!


04-14-2009, 04:57 PM
To answer your questions:

1) Make sure the defaultexpanded option is set to empty. You'll probably also want to turn off persistence:

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: false, //persist state of opened contents within browser session?

2) The script does support nested accordions. Take a look at the second example on this page: http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-bullet.htm

04-17-2009, 07:52 PM

Thanks, that seemed to work very well with what I want to do, only thing I wanted to ask you is as you can see in the above image again, i know its not the right one,I am using the nested accordian nav, but im sure this will work anyway, you see where it says collection, experience, i have been trying to add 3 more of those main menu headings,all im doing is copying this code and placing it under the next one

<h3 class="menuheader expandable">The Collection</h3>
<ul class="categoryitems">
<li><a href="#" class="subexpandable">Africa</a>

<ul class="subcategoryitems" style="margin-left: 15px">
<li><a href="#">South Africa</a></li>
<li><a href="#">Madagascar</a></li>
<li><a href="#">Kenya</a></li>
<li><a href="#">Tanzania</a></li>


That in theory should create another 1 right????