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
Fading background version 2
[View Sample]
Like above, but fades "backwards" as someone leaves the webpage.
Insert into <HEAD>
<SCRIPT LANGUAGE="JavaScript"> <!-- // Copyright (c) 1996 Tomer Shiran. All rights reserved. // Permission given to use this script provided that the copyright // notice remains as is. Additional scripts and information are // available at http://www.geocities.com/SiliconValley/9000/ // convert decimal value (0 - 255) to hexadecimal // (use .toString(16) method supported by IE) function toHex(dec) { // create list of hex characters var hexCharacters = "0123456789ABCDEF" // if number is out of range return limit if (dec < 0) return "00" if (dec > 255) return "FF" // decimal equivalent of first hex character in converted number var i = Math.floor(dec / 16) // decimal equivalent of second hex character in converted number var j = dec % 16 // return hexadecimal equivalent return hexCharacters.charAt(i) + hexCharacters.charAt(j) } // set background color to specified descriptors function setbgColor(red, green, blue) { document.bgColor = "#" + toHex(red) + toHex(green) + toHex(blue) } // fade from start to end descriptors (increase step to increase transition speed) function fade(sred, sgreen, sblue, ered, egreen, eblue, step) { // loop to create fade effect for(var i = 0; i <= step; ++i) { // set current red descriptor var red = Math.floor(sred * ((step - i) / step) + ered * (i / step)) // set current green descriptor var green = Math.floor(sgreen * ((step - i) / step) + egreen * (i / step)) // set current green descriptor var blue = Math.floor(sblue * ((step - i) / step) + eblue * (i / step)) // set background color according to descriptors setbgColor(red, green, blue) } } // --> </SCRIPT>
Insert into <BODY>
<BODY onLoad="fade(0, 0, 0, 255, 255, 255, 64)" onUnload="fade(255, 255, 255, 0, 0, 0, 64)">
Other Options