-
How do I reference an image which is sitting in a layer in JavaScript.
I am trying to do rollovers. Have them working great when outside of a layer, but when they get in layers, they don't work. Javascript Console in NN says not an object my code is below:
function imgOn(imgName) {
if (document.images) {
if (current == imgName) {
document[imgName].src = eval(imgName + "off.src");
} else {
document[imgName].src = eval(imgName + "on.src");
}
}
}
function imgOff(imgName) {
if (document.images) {
if (current == imgName) {
document[imgName].src = eval(imgName + "on.src");
} else {
document[imgName].src = eval(imgName + "off.src");
}
}
}
thanks (sorry but I didn't know where else to ask this!!)
blur
-
You could try referrencing the images as document.layers.image.... or something.. Maybe it's not finding your images 'cos it's looking in the main doc as opposed to the layer...
then again i could be talking rubbish...
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
|