spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

JavaScript Tip of the Week for 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

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business