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 - (Frames)
[View Sample]
This is an example of changing one image in another frame when passing your mouse over a number of different images.
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; } 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 FIRST ALT IMAGE"; function imageon(name) { parent.ALT IMAGE FRAME NAME.document.altimg.src = eval(name + "alton.src"); } function imageoff(name) { parent.ALT IMAGE FRAME NAME.document.altimg.src = eval(name + "alt.src"); } NN3 = true; function on(name) { if (check == true){ imageon(name); } } function off(name) { if (check == true){ imageoff(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> This is the alternate image it goes in another frame with the name that you inputed in the top script (ALT IMAGE FRAME NAME). Changing Alternate Image: <img src="YOUR ORIGIONAL ALT IMAGE" name="altimg"> This is the alternate image it goes in another frame with the name that you inputed in the top script (ALT IMAGE FRAME NAME). Changing Alternate Image: <img src="YOUR ORIGIONAL ALT IMAGE" name="altimg">
Other Options
This is an example of changing one image in another frame when passing your mouse over a number of different images. Notice how each image has it's own changing alternate image. IMPORTANT!! Make sure that the inactive images are always present, if not then you will get a nasty error message! Click the one of the links and you will see! This goes in the <head></head> tag on the page that you want the mouse over to occur. You need to edit ALT YOUR CHANGING FIRST ALT IMAGE, YOUR CHANGING FIRST ALT IMAGE, and YOUR ORIGIONAL ALT IMAGE. Also change ALT IMAGE FRAME NAME (frame location where the other images that you want to switch are located). <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; } 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 FIRST ALT IMAGE"; function imageon(name) { parent.ALT IMAGE FRAME NAME.document.altimg.src = eval(name + "alton.src"); } function imageoff(name) { parent.ALT IMAGE FRAME NAME.document.altimg.src = eval(name + "alt.src"); } NN3 = true; function on(name) { if (check == true){ imageon(name); } } function off(name) { if (check == true){ imageoff(name); } } // --> </script> Now put these lines anywhere in you HTML document. They must be in the same page as the top script. Change OUR FIRST IMAGE, YOUR SECOND IMAGE, and YOUR LINK. 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> This is the alternate image it goes in another frame with the name that you inputed in the top script (ALT IMAGE FRAME NAME). 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. image3alt = new Image(); image3alt.src = "YOUR ORIGIONAL ALT IMAGE"; image3alton = new Image(); image3alton.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".