spacer

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

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint