The problem is that your javascript function is utilizing a very specific picture.
The line "document.picture.src" is accessing the source of the "picture" image. If you have a second image, say "picture2" then you'd need to change that line of the function.
Here is a better way to do it.
First preload your images like so:
Code:
<script language = "javascript">
image0 = new Image();
image0.src = "images/file1.jpg";
image1 = new Image();
image1.src = "images/file2.jpg";
image2 = new Image();
image2.src = "images/file3.jpg";
</script>
That goes in the head of your document (between the <head> tags).
Then make your links like this:
Code:
<a href="file.html" onmouseover="image0.src='images/file1-2.jpg';"
onmouseout="image0.src='images/file1.jpg';">
<img name="image0" src="images/file1.jpg" border=0>
<a href="file2.html" onmouseover="image1.src='images/file2-2.jpg';"
onmouseout="image1.src='images/file2.jpg';">
<img name="image1" src="images/file2.jpg" border=0>
You aren't actually using a function in this example -- but you don't need to.
Bookmarks