#fcleft">



This is one of the coolest-looking scripts I have ever seen. You can use it as just a simple fade from black to your background color or you can call the function multiple times to create a neater Background Changer. Best of all, this script is smaller than the other ones of it's nature, thus it won't slow down your page like the others will. Be sure to look at the color coding. Also, you will need a knowledge of number RGB color codes in order to change this. I hope to get an easy conversion tool for this when I have the time.
The source..


<script language="Javascript">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var speed = 255

function StringArray (n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ' '
  }
}

fader = new StringArray(16)

for(var i = 0; i < 10; i++) {
  fader[i] = i
}
fader[10] = "a"
fader[11] = "b"
fader[12] = "c"
fader[13] = "d"
fader[14] = "e"
fader[15] = "f"

function hexadecimal(i) {
    return ("" + fader[Math.floor(i/16)] + fader[i%16])
}
function fade(r2,g2,b2,r1,g1,b1) {
  for(var i = 0; i <= speed; i++) {
var r = hexadecimal(Math.floor(r2 * ((speed-i)/speed) + r1 * (i/speed)))
var g = hexadecimal(Math.floor(g2 * ((speed-i)/speed) + g1 * (i/speed)))
var b = hexadecimal(Math.floor(b2 * ((speed-i)/speed) + b1 * (i/speed)))
document.bgColor = "#" + r + g + b
  }
}

fade(0,0,0,255,255,255);
fade(255,255,255,255,0,0);
fade(255,0,0,0,0,255);
fade(0,0,255,255,255,255);
//-->
</script>


Color coding..


This is the number of color changes the script makes between the initial and final colors. This is basically the control for the speed of the script. Can be between 1 and 255.
This is what calls the fader. It has two different variables, defined below. Copy this and modify it to create more color changes.
This is the RGB numbers for the initial color of the fader. The red, green, and blue are seperated by commas. As a guideline for novices, 255 is the same as "FF" and 0 is the same as "00".
This is the RGB numbers for the final color of the fader. The red, green, and blue are seperated by commas.