move the cursor over the black square
>>> this example in Swedish
>>> this example in French
code & explanations below
onMouseOver = "iljswitch(1)"1
onMouseOut = "iljswitch(0)">2
<IMG NAME = "switch1"3
SRC = "imagefile"
WIDTH = "pixel"
HEIGHT = "pixel"
BORDER = "0"></A>
Set the WIDTH and the HEIGHT of the image (ie replace pixel by relevant numbers), replace imagefile by the name of the image file you are going to use and remove all footnotes.
1 when the mouse pointer is moved in over the picture the function iljswitch is called with the argument or parameter 1 , ie 1 enters the function as nummer and the picture that will be displayed is the one that was preloaded as bild.src More about preloading the images further down.
2 when the mouse pointer leaves the picture the function iljswitch is called with the argument 0 , ie 0 enters the function as nummer and the picture that will be displayed is the one that was preloaded as bild.src
3 name the image; the NAME will be used by the java script to keep track of WHERE to display the new picture
bild = new Array()
bild= new Image() //4
bild= new Image() //5
bild.src = "first image file" //4
bild.src = "second image file" //5
document.switch1.src = bild[nummer].src //6
4 the image, that is to be displayed when the mouse pointer is not over the link, is preloaded
5 the image, that is to be displayed when the mouse pointer is over the link, is preloaded
6 this line displays a new picture at the image named switch1 ; what picture to display depends on whether the event was a mouseover or a mouseout. If the event was a mouseover nummer will be replaced by 1 and the picture that will be displayed is the one that was preloaded as bild.src
Instead of using the NAME attribute of the IMG tag to identify the image you can replace the lines
If the image is the very first image on the page i should be replaced by 0, if the image is the second image on the page i should be replaced by 1 etc.
Last modified: August 15, 1998
This page should be part of a frames system