JavaScript Tip of the Week for May 13, 1996: Spiff up the Old Page | 3 | WebReference

JavaScript Tip of the Week for May 13, 1996: Spiff up the Old Page | 3

JavaScript Tip of the Weekfor May 13, 1996: Working with FadeScript

The fading can be modified to fit your needs, e.g. you can fade from blue to green, or fade very quickly, and vice versa. It is made quite simple, because the script uses simple RGB colors. For instance, if you want to fade from white to black, instead of black to white, you would change this special section of code:
    function fadein() {
            fade(0,0,0, 255,255,255, 50);
    }
into this:
    function fadein() {
        fade(255,255,255, 0,0,0, 50);
    }
As you can see, it starts at the first R,G,B and fades to the second R,G,B. If you want to change the speed of the fading all you have to do in the same line of code is change one number. The number can be anywhere from 2 (being the fastest) to 255. In the example below, the speed is changed from medium to very fast, its starts out with:
    function fadein() {
            fade(0,0,0, 255,255,255, 50);
    }
and then is changed to a smaller number:
    function fadein() {
            fade(0,0,0, 255,255,255, 2);
    }
That's all there is to fading, I think its a great attention getter, but I worry that if everyone uses it we'll all go blind after a while. One word of advice: Do not use it more than once on any page in your site, and if you have problems with the font and link colors of you page, just put these lines of code right after the body statement, with your page's colors in it:
        document.bgColor = "color"
        document.vlinkColor = "color"
        document.linkColor = "color"
        document.fgColor = "color"
        document.alinkColor = "color"
Source