1 Falling Image Script_Modified Tue Sep 29, 2009 4:19 pm
jatmin
Moderating Team
paste it in yer js extension
pls read the copyright notice b4 using it
credits: Sir Angell de Ville
pls read the copyright notice b4 using it
- Spoiler:
- /*******************************************************
* JSnow v0.2 by Altan d.o.o. (http://www.altan.hr/snow/index.html)
* This Javascript code can be freely redistributed as long as this
* copyright notice is keept unchanged. This code is used on AS-IS
* basis and you use it on your own risk. Author of this code is not
* responsible for any damage that this code may make.
* modified by : Angell de Ville
********************************************************/
var imgTotal = 10;
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")?document.documentElement:document.body
}
if(ns6up){
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
else if(ie4up){
doc_width = iecompattest().clientWidth;
doc_height = iecompattest().clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
for(i=0;idx[i] = 0;
xp[i] = Math.random()*(doc_width-50);
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
document.getElementById("navigation").style.cssText = "z-index:1 !important";
var div = document.createElement("div");
div.id = "dot"+i;
div.style.cssText = "position:absolute;top:-100;left:0;visibility:visible;z-index:"+i;
div.innerHTML = "";
document.body.appendChild(div);
}
function snowIE_NS6(){
doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
doc_height = (ie4up && !window.opera)?iecompattest().scrollHeight : iecompattest().offsetHeight;
for(i=0;i<10;++i){
yp[i] += sty[i];
if(yp[i]>doc_height-50){
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
}
dx[i] += stx[i];
document.getElementById("dot"+i).style.top = yp[i]+"px";
document.getElementById("dot"+i).style.left = xp[i]+am[i]*Math.sin(dx[i])+"px";
}
setTimeout("snowIE_NS6()",10);
}
if(ie4up||ns6up){
snowIE_NS6();
}
credits: Sir Angell de Ville