Home Dhtml | |
Image Rollovers |
|
Credits: Created by: Mike McGrath Website: website.lineone.net/~mike_mcgrath Browser Information: NN, IE4+ Additional Notes: None |
|
This is probably the smallest image rollover script I've ever seen. You have two lines to preload all your images, and then just a small bit of script in each link to create your rollovers. Very elegant, and easy to set up. | |
Sample: Place mouse over photo on the right |
|
Copy and paste this code into the <HEAD> of your document, to preload your images: |
|
Instructions: The script for the head of your document preloads any mouseover images, so that there is no lag time for the image to download, when a user mouse is over. First, you must name all your images, like so: <img border=0 name="imagename" src="off.gif" width="100" height="68"> Then, set up your links: <a href="link.htm" onMouseOver="imagename.src='on.gif'" onMouseOut= "imagename.src='off.gif'"> If you wanted to swap several images you would set your links like this: <a href="link.htm" onMouseOver="imagename.src='on.gif'; imagename2.src='on2.gif " onMouseOut= "imagename.src='off.gif'; imagename2.src=off2.gif ">
|
Copyright 2002 KC's Webspices.