0

I have a problem. I have an image set to the background, this method is working for fire fox, here is how i got a background image.

<img src="docs/Plasma.gif" id="background"/>

<div id="content">

Right after the body tag and

img#background { position:fixed;
top:0;
left:0;
width:100%;
height:100%;
}
#content {
position:relative;
z-index:1;
}

In the styles. So, further down the page i have

img src="docs/JellyFishThumb.gif" height="50" width="75" onclick="document.background.src='docs/JellyFish.gif';"/>
 <br><img src="docs/StarFieldThumb.gif" onclick="document.background.src='docs/StarField.gif';" height="50" width="75"/>
 <br><img src="docs/PlasmaThumb.gif" onclick="document.background.src='docs/Plasma.gif';" height="50" width="75"/></center>

When someone clicks on these thumbnails it changes the backround image's source to the bigger version. It doesn't work in IE though and i am confused why. I have tried preloading the image, but I feel as though my Javascript is being ignored. Any help would be appreciated. Thank you.

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by Bubbleboy
0

Thanks for the help, but i got it to work by adding a name tag to the background image. I think IE was seeing document.background and thinking name, instead of id. So this is what i did.

<img src="docs/Plasma.gif" id="background" name="background"/>

and now it works! Thanks anyway!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.