D
deleted247906
Bonjour à tous !
Aujourd'hui un petit script pour vous permettre de faire en sorte qu'il neige sur votre forum.
Telechargez l'image
Aujourd'hui un petit script pour vous permettre de faire en sorte qu'il neige sur votre forum.
<script type="text/javascript">
var no = 40;var delai = 10;
var dx = new Array(), xp = new Array(), yp = new Array();
var am = new Array(), stx = new Array(), sty = new Array();
var i;larg_fenetre = (document.body.offsetWidth<window.innerWidth)? window.innerWidth:document.body.offsetWidth;haut_fenetre = (document.body.offsetHeight<window.innerHeight)? window.innerHeight:document.body.offsetHeight;
for (i = 0; i < no; i++) {dx = 0;xp = Math.random()*(larg_fenetre-400);yp = Math.random()*haut_fenetre;am = Math.random()*20;stx = 0.02 + Math.random()/100;sty = 0.7 + Math.random();
obj = document.getElementsByTagName('body')[0];para = document.createElement("img");para.setAttribute("src","../images/neige.gif");para.setAttribute("id","dot" + i);para.style.position = "absolute";para.style.zIndex = "2";obj.appendChild(para);
}
function neige() {
for (i = 0; i < no; i++) {dx += stx;yp += sty;
if (yp > haut_fenetre-0.5) {xp = Math.random()*(larg_fenetre-am-40);yp = 0;
}document.getElementById("dot"+i).style.top = yp + "px";document.getElementById("dot"+i).style.left = xp + am*Math.sin(dx) + "px";
}setTimeout("neige()", delai);
}
var no = 40;var delai = 10;
var dx = new Array(), xp = new Array(), yp = new Array();
var am = new Array(), stx = new Array(), sty = new Array();
var i;larg_fenetre = (document.body.offsetWidth<window.innerWidth)? window.innerWidth:document.body.offsetWidth;haut_fenetre = (document.body.offsetHeight<window.innerHeight)? window.innerHeight:document.body.offsetHeight;
for (i = 0; i < no; i++) {dx = 0;xp = Math.random()*(larg_fenetre-400);yp = Math.random()*haut_fenetre;am = Math.random()*20;stx = 0.02 + Math.random()/100;sty = 0.7 + Math.random();
obj = document.getElementsByTagName('body')[0];para = document.createElement("img");para.setAttribute("src","../images/neige.gif");para.setAttribute("id","dot" + i);para.style.position = "absolute";para.style.zIndex = "2";obj.appendChild(para);
}
function neige() {
for (i = 0; i < no; i++) {dx += stx;yp += sty;
if (yp > haut_fenetre-0.5) {xp = Math.random()*(larg_fenetre-am-40);yp = 0;
}document.getElementById("dot"+i).style.top = yp + "px";document.getElementById("dot"+i).style.left = xp + am*Math.sin(dx) + "px";
}setTimeout("neige()", delai);
}
Telechargez l'image
Vous devez être inscrit pour voir les liens ! Inscrivez-vous ou connectez-vous ici.
(Elle est en 16x16 en haut à gauche)