I've been able to get navbars with submenus to work numerous times with this code:
Very simple stuff, and the only two functions in the script. This usually works perfectly (or at least well enough).
However, this time I only get a "Object doesn't support this property or method" error when flipOut tries to execute. If I comment out the calls to flipOut, then and only then will flipIndex execute as I'd expected (but then I'm stuck with submenus cluttering up the screen).
The real headscratcher for me is that (at least, I'm pretty darned sure), it's the same code in flipIndex and flipOut, just different parameters. Are there any reasons this would work most of the time and not in one instance. And why the exact same code, referencing the exact same objects, would be fine in flipIndex but not fine in flipOut?
My apologies if what I'm doing wrong is really stupid and obvious, but I must confess myself stumped.
Code:
function flipIndex(whych, whereExx, whereWhyy) {
flipOut('serviceTwo');
flipOut('texnosTwo');
flipOut('webApsTwo');
document.getElementById(whych).style.zIndex=1;
document.getElementById(whych).style.position="absolute";
document.getElementById(whych).style.left=whereExx;
document.getElementById(whych).style.top=whereWhyy;
}
function flipOut(whych) {
document.getElementByID(whych).style.zIndex=-1;
document.getElementByID(whych).style.position="absolute";
document.getElementByID(whych).style.left="0px";
document.getElementByID(whych).style.top="0px";
}
Very simple stuff, and the only two functions in the script. This usually works perfectly (or at least well enough).
However, this time I only get a "Object doesn't support this property or method" error when flipOut tries to execute. If I comment out the calls to flipOut, then and only then will flipIndex execute as I'd expected (but then I'm stuck with submenus cluttering up the screen).
The real headscratcher for me is that (at least, I'm pretty darned sure), it's the same code in flipIndex and flipOut, just different parameters. Are there any reasons this would work most of the time and not in one instance. And why the exact same code, referencing the exact same objects, would be fine in flipIndex but not fine in flipOut?
My apologies if what I'm doing wrong is really stupid and obvious, but I must confess myself stumped.