Her er sne...
//Snow -
http://www.btinternet.com/~kurt.grigg/javascript
if ((document.getElementById) &&=20
window.addEventListener || window.attachEvent){
(function(){
//Configure here.
var num =3D 10; //Number of flakes
var timer =3D 30; //setTimeout speed. Varies on different comps
var enableinNS6 =3D 1 //Enable script in NS6/Mozilla? Snow animation =
could be slow in those browsers. (1=3Dyes, 0=3Dno).
var url_gif=3D =
"
http://ddata.over-blog.com/xxxyyy/0/06/31/40/scripts/flocons/flocons.gif=
"; // adresse de l'image
//End.
var y =3D [];
var x =3D [];
var fall =3D [];
var theFlakes =3D [];
var sfs =3D [];
var step =3D [];
var currStep =3D [];
var h,w,r;
var d =3D document;
var pix =3D "px";
var domWw =3D (typeof window.innerWidth =3D=3D "number");
var domSy =3D (typeof window.pageYOffset =3D=3D "number");
var idx =3D d.getElementsByTagName('div').length;
if (d.documentElement.style &&=20
typeof d.documentElement.style.MozOpacity =3D=3D "string")
num =3D 12;
for (i =3D 0; i < num; i++){
sfs[i] =3D 15; // Math.round(1 + Math.random() * 1);
document.write('<div id=3D"flake'+(idx+i)+'" =
style=3D"position:absolute;top:0px;left:0px;width:"><img =
src=3D"'+url_gif+'"><\/div>');
// =
'+sfs[i]+'px;height:'+sfs[i]+'px;background-color:#ffffff;font-size:'+sfs=
[i]+'px;border:1px solid #dddddd;
currStep[i] =3D 0;
fall[i] =3D (sfs[i] =3D=3D 1)?
Math.round(2 + Math.random() * 2): Math.round(3 + Math.random() * 2);
step[i] =3D (sfs[i] =3D=3D 1)?
0.05 + Math.random() * 0.1 : 0.05 + Math.random() * 0.05 ;
}
if (domWw) r =3D window;
else{=20
if (d.documentElement &&=20
typeof d.documentElement.clientWidth =3D=3D "number" &&=20
d.documentElement.clientWidth !=3D 0)
r =3D d.documentElement;
else{=20
if (d.body &&=20
typeof d.body.clientWidth =3D=3D "number")
r =3D d.body;
}
}
function winsize(){
var oh,sy,ow,sx,rh,rw;
if (domWw){
if (d.documentElement && d.defaultView &&=20
typeof d.defaultView.scrollMaxY =3D=3D "number"){
oh =3D d.documentElement.offsetHeight;
sy =3D d.defaultView.scrollMaxY;
ow =3D d.documentElement.offsetWidth*0.80;
sx =3D d.defaultView.scrollMaxX;
rh =3D oh-sy;
rw =3D ow-sx;
}
else{
rh =3D r.innerHeight;
rw =3D r.innerWidth*0.80;
}
h =3D rh - 2; =20
w =3D rw - 2;=20
}
else{
h =3D r.clientHeight - 2;=20
w =3D r.clientWidth*0.80;=20
}
}
function scrl(yx){
var y,x;
if (domSy){
y =3D r.pageYOffset;
x =3D r.pageXOffset;
}
else{
y =3D r.scrollTop;
x =3D r.scrollLeft;
}
return (yx =3D=3D 0)?y:x;
}
function snow(){
var dy,dx;
for (i =3D 0; i < num; i++){
dy =3D fall[i];
dx =3D fall[i] * Math.cos(currStep[i]);
y[i]+=3Ddy;
x[i]+=3Ddx;=20
if (x[i] >=3D w || y[i] >=3D h){
y[i] =3D -10;
x[i] =3D Math.round(Math.random() * w);
fall[i] =3D (sfs[i] =3D=3D 1)?
Math.round(2 + Math.random() * 2): Math.round(3 + Math.random() * 2);
step[i] =3D (sfs[i] =3D=3D 1)?
0.05 + Math.random() * 0.1 : 0.05 + Math.random() * 0.05 ;
}
=20
theFlakes[i].top =3D y[i] + scrl(0) + pix;
theFlakes[i].left =3D x[i] + scrl(1) + pix;
currStep[i]+=3Dstep[i];
}
setTimeout(snow,timer);
}
function init(){
winsize();
for (i =3D 0; i < num; i++){
theFlakes[i] =3D document.getElementById("flake"+(idx+i)).style;
y[i] =3D Math.round(Math.random()*h);
x[i] =3D Math.round(Math.random()*w);
}
snow();
}
if (window.addEventListener){
window.addEventListener("resize",winsize,false);
window.addEventListener("load",init,false);
} =20
else if (window.attachEvent){
window.attachEvent("onresize",winsize);
window.attachEvent("onload",init);
}=20
})();
}//End.