anpera.net
http://anpera.homeip.net/phpbb3/

Lotterie Schneeregen
http://anpera.homeip.net/phpbb3/viewtopic.php?f=34&t=5319
Seite 1 von 1

Autor:  Deus X Machina [ Mi 23 Mär, 2011 02:48 ]
Betreff des Beitrags:  Lotterie Schneeregen

In der lottery.php ist ein Stück Javacode das meiner Ansicht nach einen Bildschirmregen oder sowas auslösen soll. Meine Probleme:
1) Es funktioniert nicht
2) Ich hab von Javascript NULL Ahnung

Kann mir jemand helfen das funktionstüchtig zu bekommen? Es geht um folgendes Stück code (Wobei die ganze Datei dank Hoster und Eliwoods Sourceviewer jetzt auch einsehbar sein müsste):
$this->bbcode_second_pass_code('', '[...]
output("<SCRIPT Language='JavaScript'>
count = 40;
speed = 3;
snowfall = true;

function start() {
if (document.all) {
yMax = document.body.clientHeight;
xMax = document.body.clientWidth;
}
else if (document.layers) {
yMax = window.innerHeight;
xMax = window.innerWidth;
}

xachse = new Array();
for(i = 1; i <=40; i++) {
x = 10000;
do
{ x = Math.round(Math.random() * 10000); }
while(x > xMax-50);
xachse[i] = x;
};

yachse = new Array();
for(i = 1; i <=40; i++) { yachse[i] = - Math.round(Math.random() * 1000); };
show();
movesnow(); }

function movesnow() {
if (snowfall) {
for(i = 1; i <=count; i++)
{
wind = Math.round(Math.random() * 10);
if (wind == 2) {
if (document.all) { document.all('snow'+i).style.left = xachse[i] + wind; }
else if (document.layers) { document.layers['snow' + i].left = xachse[i] + wind; }
}
if (wind == 1) {
if (document.all) { document.all('snow'+i).style.left = xachse[i] - wind; }
else if (document.layers) { document.layers['snow' + i].left = xachse[i] - wind; }
}

if (document.all) { if (yachse[i] >= yMax-50+document.body.scrollTop) { yachse[i] = - Math.round(Math.random() * 1000); }; }
else if (document.layers) { if (yachse[i] >= yMax-50+pageYOffset) { yachse[i] = - Math.round(Math.random() * 1000); }; }

if ( count >= 30 ) { yachse[i] = yachse[i] + speed + 1; }
else { yachse[i] = yachse[i] + speed; };
if (document.all) { document.all('snow'+i).style.top = yachse[i]; }
else if (document.layers) { document.layers['snow' + i].top = yachse[i]; }
}

setTimeout('movesnow()',10);
}
}

function hide(){
for(i = 1; i <=count; i++)
{
if (document.all) { document.all('snow'+i).style.visibility = 'hidden'; }
else if (document.layers) { document.layers['snow' + i].visibility = 'hide'; }
}
}

function show(){
for(i = 1; i <=count; i++)
{
if (document.all) { document.all('snow'+i).style.visibility = 'visible'; }
else if (document.layers) { document.layers['snow' + i].visibility = 'show'; }
}
}
</SCRIPT>
<body onload='start()'>
<div id='snow1' style='position:absolute; z-index:3; font-size:15pt; color:#009900; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow2' style='position:absolute; z-index:3; font-size:15pt; color:#009900; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow3' style='position:absolute; z-index:3; font-size:15pt; color:#009900; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow4' style='position:absolute; z-index:3; font-size:15pt; color:#009900; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow5' style='position:absolute; z-index:3; font-size:15pt; color:#009900; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow6' style='position:absolute; z-index:3; font-size:15pt; color:#009900; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow7' style='position:absolute; z-index:3; font-size:15pt; color:#009900; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow8' style='position:absolute; z-index:3; font-size:15pt; color:#009900; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow9' style='position:absolute; z-index:3; font-size:15pt; color:#009900; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow10' style='position:absolute; z-index:3; font-size:15pt; color:#00CC00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow11' style='position:absolute; z-index:3; font-size:15pt; color:#00CC00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow12' style='position:absolute; z-index:3; font-size:15pt; color:#00CC00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow13' style='position:absolute; z-index:3; font-size:15pt; color:#00CC00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow14' style='position:absolute; z-index:3; font-size:15pt; color:#00CC00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>;)</div>
<div id='snow15' style='position:absolute; z-index:3; font-size:15pt; color:#00CC00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow16' style='position:absolute; z-index:3; font-size:15pt; color:#00CC00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow17' style='position:absolute; z-index:3; font-size:15pt; color:#00CC00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow18' style='position:absolute; z-index:3; font-size:15pt; color:#00CC00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow19' style='position:absolute; z-index:3; font-size:15pt; color:#00FF00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow20' style='position:absolute; z-index:3; font-size:15pt; color:#00FF00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow21' style='position:absolute; z-index:3; font-size:15pt; color:#00FF00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow22' style='position:absolute; z-index:3; font-size:15pt; color:#00FF00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow23' style='position:absolute; z-index:3; font-size:15pt; color:#00FF00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow24' style='position:absolute; z-index:3; font-size:15pt; color:#00FF00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow25' style='position:absolute; z-index:3; font-size:15pt; color:#00FF00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow26' style='position:absolute; z-index:3; font-size:15pt; color:#00FF00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow27' style='position:absolute; z-index:3; font-size:15pt; color:#00FF00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow28' style='position:absolute; z-index:3; font-size:15pt; color:#00FF00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow29' style='position:absolute; z-index:3; font-size:15pt; color:#006600; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow30' style='position:absolute; z-index:3; font-size:15pt; color:#006600; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow31' style='position:absolute; z-index:3; font-size:15pt; color:#006600; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow32' style='position:absolute; z-index:3; font-size:15pt; color:#006600; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow33' style='position:absolute; z-index:3; font-size:15pt; color:#009900; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow34' style='position:absolute; z-index:3; font-size:15pt; color:#009900; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow35' style='position:absolute; z-index:3; font-size:15pt; color:#00CC00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow36' style='position:absolute; z-index:3; font-size:15pt; color:#00CC00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow37' style='position:absolute; z-index:3; font-size:15pt; color:#00AA00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow38' style='position:absolute; z-index:3; font-size:15pt; color:#00AA00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow39' style='position:absolute; z-index:3; font-size:15pt; color:#00BB00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
<div id='snow40' style='position:absolute; z-index:3; font-size:15pt; color:#00BB00; font-family:Times New Roman, Helvetica; visibility:hidden; width:20'>\$</div>
",true);
[...]')

Autor:  Minerva [ Do 24 Mär, 2011 18:31 ]
Betreff des Beitrags:  Re: Lotterie Schneeregen

würde mal sagen, das kollidiert ein wenig mit dem <body> tag (vermutung)

Oder du hast Javascript ausgeschaltet.. kanns nicht sagen, müsste mir das ingame ankucken

Auf jeden Fall, wenn snicht funktioniert eventuell einfach n andres script nehmen

http://www.web-toolbox.net/webtoolbox/dhtml/schneefall/schneefall-bg.htm

Das hier funktioniert mit nem Bild. Ist auch n bisschen anleidung dabei wie du das dann anpassen kannst
So machst du dann einfach ein Bild mit dem Dollarzeichen als gif und ersetzt das.

Sollte in jedem Fall etwas einfacher funktionieren.
Ist grade mein vorschlag
lg
dat Mine

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/