Metachecker.net
|
TrafficChecker.net
|
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
Depressible Image Link Script
A script that makes an image link appear "depressed" as the mouse is held down on it. Similar to rollover effects, only that the effect takes place when the mouse is down.
Insert into <HEAD>
<script language="javascript1.2"> <!-- img1=new Image() img1.src="up.gif" img2=new Image() img2.src="down.gif" //--> </script>
Insert into <BODY>
<a href="whatever.htm" onMousedown="document.images['example'].src=img2.src" onMouseup="document.images['example'].src=img1.src"> <img src="up.gif" name="example" border=0></a>
Other Options
If you want multiple depressible images within one page, simply repeat steps 2 and 3 for each depressible image. When repeating step 2, be sure to change the image file names in the code to reflect the images you're using. When repeating step 3, be sure to change the part in blue ('example') to another unique name.