PDA

View Full Version : Bullet List Accordion Menu Works From Local Folder But Not On Site



Anahata
01-04-2012, 08:17 AM
1) Script Title:
Bullet List Accordion Menu
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-bullet.htm
3) Describe problem:
First of all, please excuse my extreme novice-ness when it comes to HTML / Java / etc. Perhaps I am just doing something totally stupid and obvious. (I hope that's the case.)
Anyway, I'm building a site about Chinese herbs and I installed this Accordion Menu to allow users to search for herbs by the first letter. After entering just a bit of the accordion menu content, I decided to test it out. When I load the page in Firefox from its local folder (C:\....) the accordion menu works fine. But when I load the page from its internet location - www.chineseherbinfo.com - it doesn't work. Clicking on one of the menu buttons doesn't do anything. I can't figure out why. It's the same HTML file and the ddaccordion.js file is present in both locations.
Incidentally, if there is a cleaner or better way to accomplish what I am trying to do (give people a way to look up any of about 350 herbs in a compact way), I'd be open to that.
Any help (preferably in the simplest possible language) would be much appreciated.

ddadmin
01-04-2012, 06:19 PM
In your initialization code for the menu, there should be a line break right before the "defaultexpanded" option below:


ddaccordion.init({
headerclass: "expandable", //Shared CSS class name of headers group that are expandable
contentclass: "categoryitems", //Shared CSS class name of contents group
revealtype: "click", //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: [0], //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: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["prefix", "", ""], //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
}
})

In other words, the code should be:


<script type="text/javascript">
ddaccordion.init({
headerclass: "expandable", //Shared CSS class name of headers group that are expandable
contentclass: "categoryitems", //Shared CSS class name of contents group
revealtype: "click", //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: [0], //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: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["prefix", "", ""], //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>

Anahata
01-04-2012, 08:57 PM
I think KompoZer must have altered that.
Btw, if someone can recommend a better similar program, I'd appreciate it.