Snow
|
Place this in the HEAD of your page:
|
<script language="JavaScript">
<!--
var isNS = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);
var nbflocon = 25;
var coordx=new Array(nbflocon);var coordy=new Array(nbflocon);
var vity=new Array(nbflocon);var temx=new Array(nbflocon);var decx=new Array(nbflocon);
var floc=1;
function Initsnow() {
if (isNS) {
tailley = window.innerHeight;taillex = window.innerWidth;offsety = window.pageYOffset;offsetx = window.pageXOffset;
var vara="LAYER NAME";var varb="/LAYER";var styl="";
}
else {
tailley = document.body.clientHeight;taillex = document.body.clientWidth;offsety = document.body.scrollTop;offsetx = document.body.scrollLeft;
var vara="DIV ID";var varb="/DIV";var styl='style="position:absolute;left:0px;top:0px;width:1px;height:1px;visibility:visible;"';}
for (i=0;i<nbflocon;i++){
chaine='<'+vara+'="flocon'+i+'" '+styl+'><img src="flocon'+floc+'.gif"><'+varb+'>';
document.write(chaine);
coordx[i]=80+(Math.random()*taillex-160);coordy[i]=i*(tailley/(nbflocon-1));
vity[i]=floc; temx[i]=(Math.random()*19);decx[i]=0;
floc+=1;if (floc>3){floc=1};
}
}
function snow() {
if (isNS) {tailley = window.innerHeight;taillex = window.innerWidth;offsety = window.pageYOffset;offsetx = window.pageXOffset;}
else {tailley = document.body.clientHeight;taillex = document.body.clientWidth;offsety = document.body.scrollTop;offsetx = document.body.scrollLeft;}
for (i=0;i<nbflocon;i++){
if (isNS){
eval ('document.flocon'+i+'.top = coordy[i];');
eval ('document.flocon'+i+'.left = coordx[i];');
}
else{
eval ('document.all.flocon'+i+'.style.top = coordy[i];');
eval ('document.all.flocon'+i+'.style.left = coordx[i];');
}
temx[i]+=1
if (temx[i]>20) {
decx[i]=1-(Math.random()*2);
temx[i]=0;
}
coordx[i]+=decx[i];
coordy[i]+=vity[i];
maxi=tailley+offsety;
if (coordy[i]>maxi) {coordx[i]=80+(Math.random()*taillex-160);coordy[i]=-100;}
}
setTimeout("snow()",10)
}
// -->
</script>
|
|
The "onLoad="snow()" must be placed with the text- and links-colors like this:
|
<body bgcolor="#000000" text="#FF0000" onLoad="snow()>
|
|
Place this in the BODY of your page:
|
<script>Initsnow();<script>
|
|
|