Back to JS main page

BY: Geoff Baysinger...http://fly.hiwaay.net/~gbaysing/
DATE:1996-06-28


COMMENTS FROM THE AUTHOR:

Jahf's Javascript Background Animator

This is not the world's most complicated JavaScript program ... in fact the hardest part I had to I ended grabbing from the hIadaho ColorCenter (I needed help converting decimal values into hex). The rest of the code is original. I'm not a HUGE fan of background color animation, but it was a fun project to help cut my teeth on, and I know other people used to like them.

You're welcome to use the code. You'll notice that I have a Big Ol' Comment ... I'm not requiring you to keep the entire comment, but do ask you leave the last 3 lines of the comment (heck, I need SOME way to draw people to my page ;). If you like the script feel free to send me some mail.


Call the function with this command (you do kind of need to copy the function to your page first):

bgChanger("FFFFFF","000000",25);

The parameters are as follows:

"FFFFFF"
     The first parameter names the BGCOLOR to begin with

"000000"
     The first parameter names the BGCOLOR to end with

25
     The last parameter tells the script how many "steps" to use to fade
     between the first and last BGCOLOR. (25 is fairly flicker free on 
     my system ... 50 is smoother)

Notes:

  1. You must use hex values ... color names will not work
  2. Don't put a "#" in front of the parameters, just use the Hex values
  3. The larger the last number the smoother the transition will look
  4. You can "stack" bgChanger commands to go from one color to another and another and another (like this page does ... just view the source of this page and reload to see it work)

If you want this script just choose "Save Frame As..." (in Netscape) when you have the focus on the frame.

URL: http://www.oocities.org/SiliconValley/7116/jv_ldani.html