Metachecker.net
|
FontsMadeEasy.com
|
RankChecker.net
Learn Java Script Today
|
Over 5000 Free Fonts
|
Tutorials
|
Javascript Forum
|
Other Javascript Resources
|
Cheat Sheet
JavaScript Basics
Inserting Javascript
Complete Tutorial
Advance DHTML Tutorial
Script archive
Advanced Tutorials
Alert Scripts
Animation
Audio
Background Effects
Banner Ads
Browser Window
Buttons
Button Forms
Calculcators
Calendars
Clocks & Dates
Cookies
Cursor Effects
DHMTL Games
DHTML Miscellaneous
Equivalents
Forms
Games
IE4+ Scripts
IE5+ Scripts
Image Effects
Image Miscellaneous
Links & Buttons
Math Related
Messages Miscellaneous
Miscellaneous
Mouse Tricks
Navigation
Page Details
Password Protection
Pulldown Menus
Random Stuff
Scrolling
Status Bar
Text Animation
User Detail
User Info
Window Control
Mouse Over Image - Changing Image
Insert into <HEAD>
<script language="JavaScript"> <!-- Hide from old browsers if (navigator.appVersion.indexOf("2.") != -1){ check = false; } if ((navigator.appVersion.indexOf("3.") != -1) && (navigator.appName.indexOf("Explorer") != -1)){ check = false; } else { check = true; } image1= new Image(); image1.src = "IMAGE FILE OFF"; image1on = new Image(); image1on.src = "IMAGE FILE ON"; image2= new Image(); image2.src = "IMAGE FILE OFF"; image2on = new Image(); image2on.src = "IMAGE FILE ON"; function imageon(name) { document[name].src = eval(name + "on.src"); } function imageoff(name) { document[name].src = eval(name + ".src"); } function on(name) { if (check == true){ imageon(name); } } function off(name) { if (check == true){ imageoff(name); } } // --> </script>
Insert into <BODY>
<a href="YOUR LINK" onmouseover="on('image1');" onmouseout="off('image1')"><img src="IMAGE FILE OFF" border="0" name="image1"></a><br> <a href="YOUR LINK" onmouseover="on('image2');" onmouseout="off('image2')"><img src="IMAGE FILE OFF" border="0" name="image2"></a>
Other Options
The first thing that needs to be done is the change the IMAGE FILE ON (in the top script) and the IMAGE OFF (in the top and bottom script). Now if you want add more images, you'll have to adjust the top script by adding this additional line. (this is an example of how to add a third image image)This goes after the lines that look identical. image3= new Image(); image3.src = "IMAGE FILE OFF"; image3on = new Image(); image3on.src = "IMAGE FILE ON"; Notice how "image2" went to "image3". To add a fourth image you would replace all the "image3"'s with "image4" and so on. Now put this link in the body of your document to make the third image visible. <a href="YOUR LINK" onmouseover="on('image3');" onmouseout="off('image3')"><img src="IMAGE FILE OFF" border="0" name="image3"></a> Notice how the image number went up to "image3". Repet all the steps that I just showed you to put in a fourth or fifth image and change "image3" to "image4" or "image5"!!!! It's that easy!