DOM and variables
by =?iso-8859-1?q?andy=20dunbar?= <krone9(at)yahoo.com>
|
Date: |
Fri, 31 Mar 2000 03:21:26 -0800 (PST) |
To: |
hwg-style(at)mail.hwg.org |
|
todo: View
Thread,
Original
|
|
Hi,
Hopefully someone can help before I go insane....
I have 2 lines in a javascript function to dynamically
turn on layers depending on which button the user
clicks on. The function sorts through an array called
'layerlist' and pulls out the appropriate part, then
inserting it, along with some text and another
variable called 'section' into a variable called
currentid.
All I want to do is, after building this variable
'currentid', turn the visibility for <div id="value
of current id"> on (or off). Current id is being built
correctly and this only has to work in IE.
It all seems to work up until I try and alter the
visibility where it comes up with an error saying that
currentid is not an object.
How can I get the script to interpret currentid as a
variable, and look for the id with the same value,
rather than looking for an id "currentid" to make
visible?!?!
The two lines of code follow:
currentid = "header"+layerlist[i]+"middle"+section;
currentid.style.visibility="visible";
needless to say this is bugging the hell out of me!
thanks in advance
@ndy Dunbar
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
HWG hwg-style mailing list archives,
maintained by Webmasters @ IWA