|
-
September 27th, 2002, 02:17 PM
#1
DHTML problemo
I have a problem with my dhtml on this page. Heres the code giving me the trouble:
Code:
function switchTo(toThis)
{
if (document.all)
{
theDiv=document.all(toThis).style;
}
else if (document.GetElementById)
{
theDiv=document.GetElementById(toThis).style;
}
theDiv.visibility="visible";
if (wasThis!="null")
{
wasThis.visibility="hidden";
}
wasThis=theDiv;
}
all the variables have been declared globally, and the divs i pass as the argument have been created....i had this function working earlier, but it didn't hide the first div it was used on (eg: i used it once and it showed a div, then i used it again and it didn't hide the original like intended, just went one on top of the other. I used to split up into several functions, each hiding all other divs and displaying the specified, but it wasnt' as efficient so i tried to come up with a generic one and i've failed.
The error i recieve is "object required" so as far as i can tell this has to do with me doing: theDiv.visibility="visible"; or something like that, I think perhaps i'm not getting a hold of the object correctly. I'm pretty much in the dark on this one, which is something i'm not used to . So thank's much to any help you can give.
C G C F A D--Feel the Noise
"When your life goes nowhere and leads back to me, doesn't that tell you something?"
~Gray Area Fury
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|