PDA

View Full Version : ddaccordion



roelie
06-08-2010, 09:11 AM
1) Script Title: Bullet List Accordion Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-bullet.htm

3) Describe problem: I would like to use exactly the accordion configuration as in the example, but I would preferr it if all submenu's collapse as soon as I click on a header without submenu (like "FEEDBACK" in the example) and go to that page.
I want to use it in a cms and everything is functioning allright, exept this little "item".
So, it is meant to stay on the site with every menu-item. I only want the entire menu collapsed if I for instance return to my "HOME"-page.

I hope I made myself clear and hope to get response soon :)

Many thanks in advance!

luzagodom
06-08-2010, 09:51 AM
n this menu example, the menu headers are H3 tags, with each sub menu being UL tags that expand/ contract.

roelie
06-08-2010, 09:58 AM
Thanks luzagodom, but what I actually would like to know is how to make all submenues close when I click on a menuheader without a submenu. I have tried this with collapseall, but then the page doesn't load.
Could you help me with some scripting, please?

ddadmin
06-08-2010, 10:50 PM
You can either turn of persistence in your initialization code (persiststate: false) if you don't need it, which causes all sub menus to be collapsed when a page is loaded/reloaded, or, inside the headers with no submenus, call the collapseall (http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment.htm) function. An example would be:


<h3><a href="home.htm" onClick="ddaccordion.collapseall('headerclass')">header with no sub content</a></h3>

Where "headerclass" is the name of your shared header CSS class name. This only works if you have persistence enabled, so when the new page loads, it remembers the previous page's setting of all sub menus being collapsed. It really depends on your entire menu's setup.

roelie
06-09-2010, 10:20 PM
You can either turn of persistence in your initialization code (persiststate: false) if you don't need it, which causes all sub menus to be collapsed when a page is loaded/reloaded, or, inside the headers with no submenus, call the collapseall (http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment.htm) function. An example would be:


<h3><a href="home.htm" onClick="ddaccordion.collapseall('headerclass')">header with no sub content</a></h3>

Where "headerclass" is the name of your shared header CSS class name. This only works if you have persistence enabled, so when the new page loads, it remembers the previous page's setting of all sub menus being collapsed. It really depends on your entire menu's setup.
Hi ddadmin,
Thanks a lot for your response!

I tried to implement your answer but, because the menu is getting its links from a php cms, I couldn't get it right!

Could it be possible to alter the ddaccordion.js file so that if you click on a menuheader without submenu-items, you are redirected to the right page and the accordion collapses completely?

Thanks in advance

roelie
06-11-2010, 01:12 PM
Hi ddadmin,
Thanks a lot for your response!

I tried to implement your answer but, because the menu is getting its links from a php cms, I couldn't get it right!

Could it be possible to alter the ddaccordion.js file so that if you click on a menuheader without submenu-items, you are redirected to the right page and the accordion collapses completely?

Thanks in advance
Somebody help, PLEASE???????