» home
» contact
» terms of use

FREE SCRIPTS
» new
» text
» image
» utility
» background
» animation
» date/time

FREE ONLINE TOOLS
» code generators
» text animator
» drawing animator
» color animator
» slideshow factory
» javascript speed test

FREE BASIC SNIPLETS
» alert box
» image: multi-rollover
» pop-up: centering
» more

FREE'N'CRAZY
» realtime death counter
» eyeQ
» fun ticker

RECOMMENDED LINKS
» www.dynamicdrive.com
» www.hotscripts.com

Free JavaScript: Basic Fading Image Script
This free JavaScript creates a very smooth image fade in and fade out effect on mouseover. Crossbrowser: Internet Explorer 6x/7x/8x, Firefox 2x/3x, Opera 7x/8x/9x/10x, Google Chrome 3x/4x/5x.



Configuration:

Step 1: Open the webpage that will display your image(s). Put the following code between the <head>-tag and </head>-tag:


Step 2: Open your webpage. Configure the code for your image according to the colorized explanations below.

<img src="small03.jpg" style="opacity:0.2;filter:alpha(opacity=20);" onMouseover="showinit(this)" onMouseout="hideimg(this)">


The red code is the path and name of your image.
The blue code must be placed inside the <img>-tag. Do not change the blue code.
The green number sets the starting opacity effect.
0.2 is for Firefox, Opera and Chrome. Set the value between 0.1 to 1.
20 is for Internet Explorer. Set a value between 1 to 100.