stalkio
04-14-2010, 11:51 PM
still very new to Java but I'm trying to get the background image to change when clicknig a link and this code work in all browsers but IE. I have tried the suggestions that worked for you regards ;'s, any help would be awesome.
var backImage = new Array();
backImage[0] = "url(images/bg1.jpg)";
backImage[1] = "url(images/bg2.jpg)";
backImage[2] = "";
function changeBGImage(whichImage){
document.body.style.backgroundImage = backImage[whichImage];
}
//-->
</script>
<a href="javascript:changeBGImage(1)">Change</a>
Cheers,
Stalkio
var backImage = new Array();
backImage[0] = "url(images/bg1.jpg)";
backImage[1] = "url(images/bg2.jpg)";
backImage[2] = "";
function changeBGImage(whichImage){
document.body.style.backgroundImage = backImage[whichImage];
}
//-->
</script>
<a href="javascript:changeBGImage(1)">Change</a>
Cheers,
Stalkio