Forum Moderators: open
1. Put a transparent 1x1 gif inside the central element.
2. Unless the images are all the same size, don't give the
<img id="display" src="transp.gif"> any width or height. <script>
function showImage(src)
{
document.getElementById("display").src = src
}
</script>
<img src="dog_thumb.gif" onmouseover="showImage(images/dog.jpg)">
..and that's it.
If the images are quite large, I'd recommend using
[blue]onclick[/blue], not [blue]onmouseover[/blue].
<html><head><title>show images</title>
<script>
function showImage(src) { document.getElementById("display").src = src }
</script>
</head>
<body>
<img src="image00.gif" onmouseover="showImage('image00.gif')" width="50" height="50"><br>
<img src="image01.gif" onmouseover="showImage('image01.gif')" width="50" height="50"><br>
<img src="image02.gif" onmouseover="showImage('image02.gif')" width="50" height="50"><br>
<img src="image03.gif" onmouseover="showImage('image03.gif')" width="50" height="50"><br>
<div><img id="display" src="spacer.gif"></div>
</body>
</html>
Here is an alt version of the function that will explicitly resize the display image:
function showImage(src,width,height)
{
var image = document.getElementById("display")
image.src = src
image.width = width
image.height = height
}
With function calls:
showImage('image00.gif',200,300)