Swap two images as you move your mouse in and out of the image field. Uses onMouseOver, onMouseOut and a short javascript code.
Image Swap with the Mouse
<!-- Experiments with images vegaseat 6/15/04 -->
<!-- onMouseOver, onMouseOut, JS -->
<html>
<head>
<title>Swap Images with onMouseOver and onMouseOut</title>
</head>
<body bgcolor="#FFFFCC" text="#3300FF">
<CENTER>
<FORM NAME = form1>
<H2>
Move the mouse across to swap the image ...
</H2>
<A HREF="" name= link1 onMouseOver = "ImgOver()" onMouseOut = "ImgOut()">
<IMG NAME = "IMG1" SRC = "c:/windows/web/wallpaper/follow.jpg" WIDTH = 800 HEIGHT = 600>
</A>
</CENTER>
<SCRIPT LANGUAGE= JavaScript>
function ImgOver()
{
// use an image file you have or use one of XP's wallpaper
document.form1.IMG1.src = 'c:/windows/web/wallpaper/home.jpg';
}
function ImgOut()
{
// use an image file you have or use one of XP's wallpaper
document.form1.IMG1.src = 'c:/windows/web/wallpaper/follow.jpg';
}
</SCRIPT>
</body>
</html>
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.