stormshadow
02-12-2003, 08:20 AM
Hello,
I need some help with image swapping.
I want to be able to have at least 5 pictures on the same page.
When a user click an image1, it will swap to a different image.
When the user click image2, it will again switch to a different image. and so on.
The code below works to only switch one image.
Thanx for reading.and I appreciate anyones help.
Monte
<HTML>
<HEAD>
</HEAD>
<BODY>
<IMG SRC="image1.gif" name="image" onClick="imageswap();">
<SCRIPT LANGUAGE="JavaScript">
var wImage = false;
function imageswap(){
wImage = !wImage;
if (wImage == true) {document.image.src="image1.gif";}
if (wImage == false) {document.image.src="image2.gif";}
}
</SCRIPT>
</BODY>
</HTML>
I need some help with image swapping.
I want to be able to have at least 5 pictures on the same page.
When a user click an image1, it will swap to a different image.
When the user click image2, it will again switch to a different image. and so on.
The code below works to only switch one image.
Thanx for reading.and I appreciate anyones help.
Monte
<HTML>
<HEAD>
</HEAD>
<BODY>
<IMG SRC="image1.gif" name="image" onClick="imageswap();">
<SCRIPT LANGUAGE="JavaScript">
var wImage = false;
function imageswap(){
wImage = !wImage;
if (wImage == true) {document.image.src="image1.gif";}
if (wImage == false) {document.image.src="image2.gif";}
}
</SCRIPT>
</BODY>
</HTML>