View Full Version : How to modify accordion menu script behaviour

01-14-2010, 02:51 PM
1) Script Title: Accordion Menu script (v1.7.1)
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu.htm

3) Describe problem:

First problem
Here is menu based on the Bullet list: http://dzialam.pl/files/fundmenu/
How to collapse expanded submenu(ie. news) by clicking on the "nonexpandable" category (like Strona glowna or Z dzieckiem w kinie)

Second problem
Menu based on the Glossy: http://dzialam.pl/files/glossy/menu.html
Is possible to change expand direction? I moved right last expandable category (Komercyjne) by positioning but i dont know how to make expand from left to right.
Final result I want to obtain is http://dzialam.pl/files/menu/menu.html
Is possible to make it with accordion?
If no, which script I should use to take this effect and keep accordion funcionality like page loading delay, preserving state of the contents within a browser session etc.?

01-14-2010, 08:46 PM
For 1), you'll want to look at invoking the collapseone() function (http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment.htm) manually. In this case, you might add something like the below event handler inside your sub menu container:

<ul class="categoryitems" onClick="ddaccordion.collapseone('groupname', 0)">

<li><a href="#">Polityka</a></li>

<li><a href="#">Kultura</a></li>

<li><a href="#">Praca</a></li>

<li><a href="#">Nasze akcje</a></li>

<li><a href="#">Wydarzenia</a></li>


Please see the documentation on this function for more info. For 2), there's no easy way to turn the menu into side expanding unfortunately. Horizontal Accordion (http://www.dynamicdrive.com/dynamicindex17/haccordion.htm) may be closer to what you're looking for.