PDA

View Full Version : onopenclose of accordian menu



JeffSinNHUSA
07-04-2011, 09:14 PM
Glossy Accordion Menu Script

http://dynamicdrive.com/dynamicindex17/ddaccordionmenu-glossy.htm

I am trying to modify the script to expand the accordion menu and navigate to the corresponding URL when a menu header is clicked. I know this will involve the onopenclose event, but I am not sure how to make it redirect to the new URL.

Example: http://www.wegoplaces.com/FLOrlando_Region_40.aspx
If you click on "Things to do", it should expand the accordion and go to http://www.wegoplaces.com/FLOrlando_Region_40_Cat_Activities.aspx and leave the accordion menu open

Thanks!

Jeff

ddadmin
07-06-2011, 09:23 AM
Try making the changes in red to the initialization code of your accordion menu on the affected pages:


ddaccordion.init({
headerclass: "submenuheader", //Shared CSS class name of headers group
contentclass: "submenu", //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: [], //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: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["suffix", "<img src='http://www.WeGoPlaces.com/User%20Interface/Images/plus.gif' class='statusicon' />", "<img src='http://www.WeGoPlaces.com/User%20Interface/Images/minus.gif' class='statusicon' />"], //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
}
})

JeffSinNHUSA
07-11-2011, 01:29 PM
It's better but still flickers. On a click, it expands the menu, then navigates to a new page with a collapsed menu, then expands the menu again.

Is there any way to skip the first expansion? IE - navigate, then expand?

Thanks,

Jeff

ddadmin
07-12-2011, 05:41 AM
With the changes the behavior should now be: click, expand, then navigate to the new page with the menu header in question already expanded (not collapsed initially before expanding again on the new page). Is this not the case for you?

JeffSinNHUSA
07-12-2011, 05:31 PM
No - that is not the case. It clicks, expands, navigates to page with collapsed menu, then expands.

I will have an example posted this evening.

JeffSinNHUSA
07-13-2011, 01:29 AM
Here is the link: http://www.l-com.com

JeffSinNHUSA
07-25-2011, 02:18 PM
Anyone?