PDA

View Full Version : Need to Change the Way Accordion Menu Links Behave



ETpro
09-01-2010, 02:05 AM
Glossy Accordion Menu

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

OnClick, I want the top-level text links, the ones with the [+] box before them, to not only open the accordion but to forward the user to the URL in the <a...> tag wrapped around them. but I want the [+] box to instead control the accordion feature but NOT forward the user to another page.

In other words, on http://www.borderstogo.com/ if the user clicks the BUNDLE LOTS text link, I want that to take the user to http://www.borderstogo.com/bundlelots.html AND open the accordion DIV below BUNDLE LOTS. If the user clicks the [+] box, I want to open the accordion div, but NOT change the page.

Can this be done?


the controlling styles are at the bottom of http://www.borderstogo.com/css-edits.css

ETpro
09-01-2010, 06:48 PM
Bump, Is this even possible? If I contract with a programmer to do it, am I looking at something simple or a complete do-over?

ddadmin
09-02-2010, 11:17 PM
Ok, try the below modified .js file, which should do it.

ETpro
09-03-2010, 12:30 AM
Ok, try the below modified .js file, which should do it.I swapped this for what was there. Doesn't change the behavior at all. The text links still roll the accordion down, but won't go to the URL they are aimed at. That's kind of a killer for this site, because those are all top-level section pages, and this leaves them unreachable. Seems like this would be an important feautre to have for the Accordion Menu.

ddadmin
09-03-2010, 10:04 PM
The "revealtype" setting should be set to "clickgo":


<script type="text/javascript">
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='/lib/yhst-68986320726817/bullet-more.gif' class='statusicon' />", "<img src='/lib/yhst-68986320726817/bullet-less.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
}
})
</script>

ETpro
09-04-2010, 04:30 PM
The "revealtype" setting should be set to "clickgo":
Doh! I should have realized that. It works fine now. Thanks.