Hello modx friends. I reached my 8 hour limit of beating my head against a wall and decided to ask for some help.
Working in Revo 2.0.8
I’m trying to incorporate the
http://wiki.modxcms.com/index.php/Accordion_menu_with_Wayfinder into my website to little success. I’ve followed everything to a t, and I keep on getting the error message
"Effect is not defined
new Effect.Parallel( "
I have all of the javascript linked in the <head>, which I appears to be linked properly in the source code.
The css appears to be working perfectly.
Is there something I’m not understanding about linking js?
you can view the site here:
http://mikeo.net/highconceptlaboratories/
Here’s my wayfinder call:
[[Wayfinder? &startId=`0` &level=`2` &outerTpl=`wfOuter` &innerTpl=`wfInner` &parentRowHereTpl=`wfParentRowHere` &parentRowTpl=`wfParentRow` &activeParentRowTpl=`wfParentRowHere` &jsTpl=`wfJs`]]
and here’s the javascript.
<script type="text/javascript">
function accordion(el) {
if ($(’visible’) == el) {
new Effect.Parallel(
[
new Effect.SlideUp(el.parentNode.id+’-body’)
], {
duration: 0.2
});
el.id=’’;
return;
}
if ($(’visible’)) {
var eldown = el.parentNode.id+’-body’;
var elup = $(’visible’).parentNode.id+’-body’;
new Effect.Parallel(
[
new Effect.SlideUp(elup),
new Effect.SlideDown(eldown)
], {
duration: 0.2
});
$(’visible’).id = ’’;
}
else{
new Effect.Parallel(
[
new Effect.SlideDown(el.parentNode.id+’-body’)
], {
duration: 0.2
});
}
el.id = ’visible’;
}
function init() {
// hide all elements apart from the one with id visible
var acc = document.getElementById(’accordion’);
var apanels = acc.getElementsByTagName(’div’);
for (i = 0; i < apanels.length; i++) {
if (apanels[i].className == ’panel_body’) {
apanels[i].style.display = ’none’;
}
}
var tmpx = document.getElementById(’visible’);
if (tmpx){
var avis = tmpx.parentNode.id+’-body’;
document.getElementById(avis).style.display = ’block’;
}
}
function addEvent(elm, evType, fn, useCapture) {
elm["on"+evType]=fn;return;
}
addEvent(window, "load", init);
</script>
is it something else?
thanks so much in advance