|
General Details
|
|
JavaScript
|
|
Posted 3.11 Years Ago
|
|
424 Views
|
|
Received 0 Ratings
|
|
Easy-to-Use Image Rollover
Description
This is a very simple Javascript code for creating image rollover effects. A function is created in Javascript to carry out the command, and the rest is HTML.
The function is first called when the image is rolled over. The parameters of the function are the tags id and the new image to be used (in the JS, 'images/' is already specified as the image directory. Change/remove depending on your personal directory settings).
After the image is rolled over, the JS is called with the parameters. The first part will find the tag using the ID specified, and the second part will change the SRC of the image with the second parameter.
When rolling out of the image, the same function is called with the same ID, except this time we change the second parameter back to pic1 (or whatever). This will make the picture switch back to it's original state.
All you need to remember is to change around arguments and IDs for each image. You can also use 'innerHTML' rather than 'SRC' if you want, but you will have to make some changes to the code.
Source Code
|
Download Source Code
imagerollover.zip ( 0.00Mb )
|
NEVER open a .exe, .bat, .cmd, or other executable file since that is where viruses are likely to live. Please virus scan all files you download.
|
Comments
| Please login to post comments. |
More "JavaScript" Source Codes By This Author
Recently Posted "JavaScript" Source Codes
Recently Rated "JavaScript" Source Codes
|