javascript snow
If everything is working properly, you should be watching the first computer snowfall of the season! This is an example of a script that doesn't have much purpose other than to impress your visitors and add a unique sense of fun to your site.
The script that makes the snow fall can be found in the body of this page (or on this page) and uses a gif image of a snowflake to randomly place flakes at the top of the screen and then move them down the window. If you don't see the flakes, then you are probably using a browser that doesn't support Java script version 1.2.
To use the script drag a JavaScript Object
from the Basic Objects palette to
top of your editor window. This icon must be the first thing on the page although your visitors will not actually see the icon or the script. Double-click on the Javascript icon and paste the script into the window. Don't include the opening and closing SCRIPT tags but do include the author's credit lines. You must also have the snowflake graphic in the same folder with the page (download the image below).
![]()
If you want another image to replace the snowflake, you will need to change the line
var snowsrc="snow.gif"
at the top of the script and include the name of the image you want to use.
You can also change the number of flakes on the screen at any one time by editing the line
var no = 10;
also at the top of the script.
You may have noticed that the flakes don't fall below a certain point on the page. The script is set up for a 800x600 pixel window and will not fall any farther than 600 pixels down the page. If you want to try adjusting this, change the numbers in this line
var i, doc_width = 800, doc_height = 600;
which is the 10th line, if you don't count the author's credit or blank lines. However, on some slower computers changing this or the number of flakes may slow everything down as the computer tries to juggle more snow.
This script came from the Dynamic Drive web site where you can find a large number of scripts to enhance your web pages. For a variation on snow, try this script that puts bubbles rising up on your page or this one that blows leaves all over the page.

