promotingspace.net
Aug 30th 2008, 6:17 pm
Hi
I want to dsplay 3 images for a product. one image tag, and I’d like 3 small tags with images (corresponding to Image1, Image2, Image3 of the product ( the image names are in database) that when you rollover them the large image changes into that image. I used this code but the image does not change on mouseover
<html><head>
<script type='text/javascript'>
Function changeImg (which1) {
var obj
obj = document.getElementById('big')
switch (which1) {
case 1:
obj.src='image1.JPG'
break;
case 2:
obj.src='image2.GIF'
break;
case 3:
obj.src='image3.JPG'
}
}
</script></head>
...
...
<div><img id='big' src='default.JPG'></div>
<div><img src='img1-sm.JPG' onMouseOver='changeImg(1);'>
<img src='img2-sm.GIF' onMouseOver='changeImg(2);'>
<img src='img3-sm.GIF' onMouseOver='changeImg(3);'>
</div>
...</html>
I want to dsplay 3 images for a product. one image tag, and I’d like 3 small tags with images (corresponding to Image1, Image2, Image3 of the product ( the image names are in database) that when you rollover them the large image changes into that image. I used this code but the image does not change on mouseover
<html><head>
<script type='text/javascript'>
Function changeImg (which1) {
var obj
obj = document.getElementById('big')
switch (which1) {
case 1:
obj.src='image1.JPG'
break;
case 2:
obj.src='image2.GIF'
break;
case 3:
obj.src='image3.JPG'
}
}
</script></head>
...
...
<div><img id='big' src='default.JPG'></div>
<div><img src='img1-sm.JPG' onMouseOver='changeImg(1);'>
<img src='img2-sm.GIF' onMouseOver='changeImg(2);'>
<img src='img3-sm.GIF' onMouseOver='changeImg(3);'>
</div>
...</html>