spacer

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

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

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


The Network for Technology Professionals

Search:

About Internet.com

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

webref The latest from WebReference.com Browse >
Installing and Using Meeplace, the Business Review CMS · Sending an HTML and Plain Text E-newsletter with ASP.NET, Part 2 · Create Multilingual Web Sites with Windows Unicode Fonts
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Telehealth Takes Hold In Upstate New York · Ten Wi-Fi Security Threats to Monitor · SanDisk's SSD As Rapid As It Is Reliable