Log in

View Full Version : Menu doesn't always collapse



parboy
01-05-2010, 09:44 PM
1) Script Title: Accordion Content script

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

3) Describe problem:

Sub Menus expand when the primary link for that section is clicked. They collapse when that primary link is clicked again or when another primary link with an expandable sub-section is clicked. My problem is, when clicking a primary link that doesn't expand (like Home page) the previous section doesn't collapse and that's confusing to a user who goes to Home page but sees the "Services" section expanded. Is there a way to get Services to collapse when Home is clicked?

jscheuer1
01-06-2010, 07:08 AM
In your ddaccordion.init set:


onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)


persiststate: false, //persist state of opened contents within browser session?

If there is a particular header you need to be expanded on a particular page, set it with (also in your ddaccordion.init) its number (expandable headers are numbered 0 to whatever) here:


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

for that page. However, for the home page, where you say you want none expanded, use:


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

muflyn
01-28-2010, 04:27 PM
I have the exact same problem, but changing the ddaccordion.init set didn't solve my problem...

I have 6 main menus and only 4 of them have sub-menus. Everything works fine, but when I click the menu without sub-menu the previous menu stays open. if I change the ddaccordion.init set (as indicated) all menus stay closed... What I want is that when I click on a head menu (with or without sub-menus) the previous menu to collapses. is this possible?

here's my test site: http://citar.artes.ucp.pt/mtpnp/temp_teste/

tks