spacer

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

Developer News
iPhone Users Just Want to Have Fun
Oops! I Fixed the Linux Kernel
Jim Zemlin: The New Center of Linux Gravity
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



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Performance Optimizations for High Speed JavaScript · Advanced Web Performance Optimization · Simple Comments Meets OpenID
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Installing Oracle E-Business Suite R12 on Windows 2003 · When the Cloud Storms on You · eBay Watch: DSR 4.3 Tips, Tactics and Seller POV