- Joined
- Jan 17, 2008
- Messages
- 16
- Reaction score
- 0
- Points
- 1
- Your Mac's Specs
- MacBook Pro: 2.16 GHz 2GB ram
I have found a code that changes the background image of a page. Is it possible to adapt it to change an image on the page?
Can you help?
Code:
<script language="JavaScript">
<!--
// Copyright 2001 by www.CodeBelly.com
// Please do *not* remove this notice.
var backImage = new Array();
backImage[0] = "../gallery_pages/images/stupid/full-32 King Stupid Main Set.JPG";
backImage[1] = "../gallery_pages/images/stupid/full-33 King Stupid Control Desk.jpg";
backImage[2] = "../gallery_pages/images/stupid/full-34 King Stupid Main Set Rev..JPG";
function changeBGImage(whichImage){
if (document.body){
document.body.background = backImage[whichImage];
}
}
//-->
</script>
Can you help?