es schneit auf der HP

VIPbanner_de

www.VIPbanner.de
ID: 72674
L
1 Mai 2006
2.598
150
hi.. ich habe ein schnee script.. allerdings schneits da 10 schneeflocken.. die schneien bis zum ende der Seite (das ist ziemlich weit unten *gg*) und erst wenn unten die 1. flocke ausm bild weg ist kommt oben die erste neue wieder... ich hätte gerne ein schnee script das gleichmäßig viel schnee macht und das die schneeflocken bis zum seitenende fallen ohne das man oben warten muss bis unten die ersten ausm bild sind.

Das ist mein aktuelles script:

<script language="JavaScript">
var snowsrc="./images/schnee.gif"
var no = 10;

var ns4 = (document.layers) ? 1 : 0;
var ie = (document.all ) ? 1 : 0;
var dom = (document.getElementById && !document.all) ? 1 : 0;

var dx, xp, yp;
var am, stx, sty;
var i;
var doc_width = screen.availWidth;
var doc_height = screen.availHeight;


if (ns4)
{ doc_width = self.innerWidth;
doc_height = self.innerHeight; }
else if (ie)
{ doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight; }
else if (dom)
{ doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight; }


dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();

for (i = 0; i < no; ++ i)
{
dx = 0;
xp = Math.random()*(doc_width-50);
yp = Math.random()*doc_height;
am = Math.random()*20;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();

if (ns4)
{
if (i == 0)
{ document.write("<layer name='dot"+ i +"' left='-20' top='-20' visibility='show'><img src='"+snowsrc+"' border='0'></layer>"); }
else
{ document.write("<layer name='dot"+ i +"' left='-20' top='-20' visibility='show'><img src='"+snowsrc+"' border='0'></layer>"); }
}
else if (ie)
{
if (i == 0)
{ document.write("<div id='dot"+ i +"' style='position:absolute; z-index:"+ i +"; visibility:visible; top:-20px; left:-20px;'><img src='"+snowsrc+"' border='0'></div>"); }
else
{ document.write("<div id='dot"+ i +"' style='position:absolute; z-index:"+ i +"; visibility:visible; top:-20px; left:-20px;'><img src='"+snowsrc+"' border='0'></div>"); }
}
else if (dom)
{
if (i == 0)
{ document.write("<div id='dot"+ i +"' style='position:absolute; z-index:"+ i +"; visibility:visible; top:-20px; left:-20px;'><img src='"+snowsrc+"' border='0'></div>"); }
else
{ document.write("<div id='dot"+ i +"' style='position:absolute; z-index:"+ i +"; visibility:visible; top:-20px; left:-20px;'><img src='"+snowsrc+"' border='0'></div>"); }
}
}

function snowNS4() {
for (i = 0; i < no; ++ i) {
yp += sty;
if (yp > doc_height-50) {
xp = Math.random()*(doc_width-am-30);
yp = 0;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx += stx;
document.layers["dot"+i].top = yp;
document.layers["dot"+i].left = xp + am*Math.sin(dx);
}
setTimeout("snowNS4()", 10);
}

function snowIE() {
for (i = 0; i < no; ++ i) {
yp += sty;
if (yp > doc_height-50) {
xp = Math.random()*(doc_width-am-30);
yp = 0;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx += stx;
document.all["dot"+i].style.pixelTop = yp;
document.all["dot"+i].style.pixelLeft = xp + am*Math.sin(dx);
}
setTimeout("snowIE()", 10);
}

function snowDOM() {
for (i = 0; i < no; ++ i) {
yp += sty;
if (yp > doc_height-50) {
xp = Math.random()*(doc_width-am-30);
yp = 0;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx += stx;
document.getElementById("dot"+i).style.top = yp;
document.getElementById("dot"+i).style.left = xp + am*Math.sin(dx);
}
setTimeout("snowDOM()", 10);
}

if (ns4)
{ snowNS4(); }
else if (ie)
{ snowIE(); }
else if (dom)
{ snowDOM(); }

</script>
 
in der dritten zeite steht no=10; mach da mal no=1000; draus und du hast deinen schneestrum. (vorrausgesetzt du hast nen schnellen rechner)
 
soweit war ich auch schon :) damit ist das problem aber immer noch nicht gelöst.. wenn der schnee im portal fällt.. dann kommt am anfang ganz viel.. und der fällt dann bis zum seitenende (relativ weit unten) und bis der unten ist ist oben wieder alles ohne schnee :)

*EDIT*

Der schnee soll gleichmäßig fallen... und nicht alles auf einmal und das wars dann... solange bis der schnee unten weg ist und dann oben wieder kommt... das scripot ist nur ein beispiel.. wer ein besseres hat kanns gerne posten...
 
Ich hab da unlängst im Internet ein Script gefunden, wo das gleichmäßig ist. Such in Google unter "snow javascript" und du wirst sicher fündig :)