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 Alternate Image
Linked Image #1:
Linked Image #2:
Changing Alternate Image:
Insert into <HEAD>
<script language="JavaScript"> <!-- Hide from old browsers var NN3 = false; image1alt = new Image(); image1alt.src = "YOUR ORIGIONAL ALT IMAGE"; image1alton = new Image(); image1alton.src = "YOUR CHANGING FIRST ALT IMAGE"; image2alt = new Image(); image2alt.src = "YOUR ORIGIONAL ALT IMAGE"; image2alton = new Image(); image2alton.src = "YOUR CHANGING SECOND ALT IMAGE"; function on3(name) { document["altimg"].src = eval(name + "alton.src"); } function off3(name) { document["altimg"].src = eval(name + "alt.src"); } NN3 = true; function on(name) { if (NN3) on3(name); } function off(name) { if (NN3) off3(name); } // --> </script>
Insert into <BODY>
Linked Image #1: <a href="YOUR LINK" onmouseover="on('image1');" onmouseout="off('image1')"><img src="YOUR FIRST IMAGE" border="0"></a> Linked Image #2: <a href="YOUR LINK" onmouseover="on('image2');" onmouseout="off('image2')"><img src="YOUR SECOND IMAGE" border="0"></a> Changing Alternate Image: <img src="YOUR ORIGIONAL ALT IMAGE" name="altimg">
Other Options
First thing to do is to put this in your <head></head> tag. You will need to edit ALT YOUR CHANGING FIRST ALT IMAGE, YOUR CHANGING SECOND ALT IMAGE, IMAGE ON, and ALT IMAGE OFF. That is your alternating image that changes, for example, mine are the numbers.) <script language="JavaScript"> <!-- Hide from old browsers var NN3 = false; image1alt = new Image(); image1alt.src = "YOUR ORIGIONAL ALT IMAGE"; image1alton = new Image(); image1alton.src = "YOUR CHANGING FIRST ALT IMAGE"; image2alt = new Image(); image2alt.src = "YOUR ORIGIONAL ALT IMAGE"; image2alton = new Image(); image2alton.src = "YOUR CHANGING SECOND ALT IMAGE"; function on3(name) { document["altimg"].src = eval(name + "alton.src"); } function off3(name) { document["altimg"].src = eval(name + "alt.src"); } NN3 = true; function on(name) { if (NN3) on3(name); } function off(name) { if (NN3) off3(name); } // --> </script> Now put these lines anywhere in you HTML document Linked Image #1: <a href="YOUR LINK" onmouseover="on('image1');" onmouseout="off('image1')"><img src="YOUR FIRST IMAGE" border="0"></a> Linked Image #2: <a href="YOUR LINK" onmouseover="on('image2');" onmouseout="off('image2')"><img src="YOUR SECOND IMAGE" border="0"></a> Changing Alternate Image: <img src="YOUR ORIGIONAL ALT IMAGE" name="altimg"> Now change YOUR LINK, YOUR FIRST IMAGE, YOUR SECOND IMAGE, and YOUR ORIGIONAL ALT IMAGE. 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. image2alt = new Image(); image2alt.src = "YOUR ORIGIONAL ALT IMAGE"; image2alton = new Image(); image2alton.src = "YOUR CHANGING THIRD ALT IMAGE"; Notice how "image2alt" went to "image3alt" and "image2alton" went to "image3alton". To add a fourth image you would replace all the "image3alt"'s with "image4alt" and so on. Now put this link in the body of your document to make the third image visible. Linked Image #3 <a href="YOUR LINK" onmouseover="on('image3');" onmouseout="off('image3')"><img src="YOUR THIRD IMAGE" border="0"></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". Same goes for "image3alt".