How do you make a picture change when the mouseover event occurs?
Printable View
How do you make a picture change when the mouseover event occurs?
Code:<a href="someplace.html"
onMouseOver="document.images['myimage'].src='hot.gif'"
onMouseOut="document.images['myimage'].src='cold.gif'"
><img name="myimage" src="cold.gif"></a>
A better way is to create an array of images, in a function or not, (so long as it is created at runtime) and use a function to swap the image from this array. This guarantees (virtually) that the images will all load before you try a mouseOver event, so the effect is faster and smoother.
Go to http://www.endeavour.net.au/index2.html and take a look at the code in the left menu frame. That is a working one, I can't be stuffed duplicating it now...
Get a two Layer place a diffrent picture in it ..
then in set a behaviour that on mouse over show one image and on mouse out second image...
sandin:D
What do you mean by two layer? I'm not familiar with that one. IS it as *searching for appropriate word* usable(??) as JavaScript image.src swaps? That is, will as many browsers recognise it?