home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip Hitware 7 A
/
CHIP_HITWARE_7A.iso
/
internet
/
Webmaster
/
_SETUP.4
/
Group3
/
bgf.jav
< prev
next >
Wrap
Text File
|
1998-12-30
|
1KB
|
65 lines
<!---BeginTitle--->Background Fade Black to White<!---BeginJAVHead---><SCRIPT LANGUAGE="JavaScript">
<!-- JavaScript by Jacob Friis Larsen ---
window.defaultStatus = "Jacobs Java enhanced HomePage";
// FadeScript begin
function MakeArray(N)
{
this.length = N;
for (I = 1; I <= N; I++)
this[I] = 0;
return this;
}
Hexa = new MakeArray(16);
for (I = 0; I < 10; I++)
Hexa[I] = I;
Hexa[10]="A"; Hexa[11]="B"; Hexa[12]="C";
Hexa[13]="D"; Hexa[14]="E"; Hexa[15]="F";
function Hex(I)
{
if (I < 0)
return "00";
else
if (I > 255)
return "FF";
else
return "" + Hexa[Math.floor(I/16)] + Hexa[I%16];
}
function SetbgColor(R, G, B)
{
HexRed = Hex(R); HexGreen = Hex(G); HexBlue = Hex(B);
document.bgColor = "#" + HexRed + HexGreen + HexBlue;
}
function Fade(StartRed, StartGreen, StartBlue, EndRed, EndGreen, EndBlue,
Step)
{
for(I = 0; I <= Step; I++)
{
Rtmp = Math.floor(StartRed * ((Step-I)/Step) + EndRed * (I/Step));
Gtmp = Math.floor(StartGreen * ((Step-I)/Step) + EndGreen * (I/Step));
Btmp = Math.floor(StartBlue * ((Step-I)/Step) + EndBlue * (I/Step));
SetbgColor (Rtmp,Gtmp,Btmp);
}
}
function FadeIn()
{
Fade(0,0,0, 255,255,255, 64);
}
FadeIn();
// End of FadeScript
// --- End hiding from JavaScript challenged browsers -->
</SCRIPT><!---BeginJAVBody---><!--EndJAVBody-->