topical media & game development
graphic-javascript-effect-background-loop-effect.htm / htm
<!-- TWO STEPS TO INSTALL CONTINUOUS FADER:
1. Paste the first code into the HEAD of your HTML document
2. Copy the final coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into HEAD of your document -->
<HEAD>
<SCRIPT LANGUAGE="Javascript">
<!-- This script and many more are available online free at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var COLOR = 999999
var woot = 0
function stoploop() {
document.bgColor = '#000000';
clearTimeout(loopID);
}
function loopBackground() {
if (COLOR > 0) {
document.bgColor = '#' + COLOR
COLOR -= 111111
loopID = setTimeout("loopBackground()",1)
} else {
document.bgColor = '#000000'
woot += 10
COLOR = 999999
COLOR -= woot
loopID = setTimeout("loopBackground()",1)
}
}
// End -->
</SCRIPT>
</HEAD>
<!-- STEP TWO: Add this form to the body of the HTML document -->
<BODY>
<CENTER>
<FORM NAME="background">
<INPUT TYPE="button" VALUE="Start bgColor WARP"
onClick="loopBackground()">
<br>
<input type="button" value="Stop bgColor WARP" onClick="stoploop()">
</FORM>
</CENTER>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 1.16 KB -->
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.