Autor |
Nachricht |
-
dein-lieblingsbuch
Premium
Wohnort: Berlin
|
04.11.2008 um 07:48 (UTC) Titel: Schneefallmodus bei CSS |
|
|
Hi
Da ich gerade meine Seite für Weihnachten vorbereite , habe ich
auch den Schneefallmodus ausprobiert. Leider musste ich feststellen,
dass der ;bei mir nicht funktioniert , allerdings glaube ich, dass
das mit meinem CSS Design zusammenhängt. Was kann ich tun oder
welchen Code muss ich einfügen und wo soll ich den einfügen damits bei mir schneit .
Es kann auch gerne ein externer Code sein
Danke für Die Hilfe
Liebe Grüße
FLO
Zuletzt bearbeitet von dein-lieblingsbuch am 04.11.2008, 08:49, insgesamt 2-mal bearbeitet
|
|
↑
|
|
|
-
mac-zone
|
04.11.2008 um 08:22 (UTC) Titel: |
|
|
Probiers mal mit diesem Code vieleicht funktioneiert der
Zitat: <!-- präsentiert von kostenlose-javascripts.de -->
<script type='text/javascript'>
<!--
var no = 18; // Anzahl der Schneeflocken
var speed = 25; // Geschwindigkeit -> je kleiner die Zahl, desto schneller
var snowflake = "snow.gif";
var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width, doc_height;
doc_width = document.body.clientWidth;
doc_height = 1100;
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[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
if (i == 0) {
document.write("<div id=\"schneedot"+ i +"\" style=\"position: ");
document.write("absolute; z-index: "+ i +"; visibility: ");
document.write("visible; top: 15px; left: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"schneedot"+ i +"\" style=\"position: ");
document.write("absolute; z-index: "+ i +"; visibility: ");
document.write("visible; top: 15px; left: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
}
}
function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
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("schneedot"+i).style.top = yp[i] + "px";
document.getElementById("schneedot"+i).style.left = (xp[i] + am[i]*Math.sin(dx[i])) + "px";
}
setTimeout("snowIE()", speed);
}
//-->
</script>
<br />
<div id="kostenlosejavascripts" align="center"><a href="http://www.kostenlose-javascripts.de/javascripts/verschiedenes/schneeflocken-mit-bildern.html" title="Schnee" target="_blank">Schnee für deine Homepage</a></div>
<br />
<script type="text/javascript" src="http://www.kostenlose-javascripts.de/startScript.php?id=273"></script>
<!-- präsentiert von kostenlose-javascripts.de -->
Zuletzt bearbeitet von mac-zone am 04.11.2008, 11:30, insgesamt einmal bearbeitet
|
|
↑
|
|
|
-
dein-lieblingsbuch
Premium
Wohnort: Berlin
|
04.11.2008 um 08:27 (UTC) Titel: |
|
|
Hi!!
Erstmal danke für den Code, aber der hat
leider auch nicht funktioniert.
Bei mir macht sich langsam das Gefühl breit,
dass der Schnee hinter dem Design fällt. |
|
↑
|
|
|
-
coolplace
Wohnort: USB = United States of Bücken
|
04.11.2008 um 10:31 (UTC) Titel: |
|
|
Ich habe mal rot markiert, was Du probeweise mal ändern kannst:
|
|
↑
|
|
|
-
dein-lieblingsbuch
Premium
Wohnort: Berlin
|
04.11.2008 um 11:24 (UTC) Titel: |
|
|
Es hat leider auch mit dem ausgestauschten Code nicht funktioniert |
|
↑
|
|
|
-
coolplace
Wohnort: USB = United States of Bücken
|
04.11.2008 um 22:47 (UTC) Titel: |
|
|
Den Bildnamen hast Du aber schon ausgetauscht?
Hier mal mit einem Beispielbild der komplette Code.
In meinen Versuchen hat es geklappt:
Zitat: <script type='text/javascript'>
<!--
var no = 18; // Anzahl der Schneeflocken
var speed = 25; // Geschwindigkeit -> je kleiner die Zahl, desto schneller
var snowflake = "http://www.homepage-baukasten.de/forum/templates/subSilver/images/lang_german/icon_quote.gif";
var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width, doc_height;
doc_width = 1000;
doc_height = 1100;
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[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
if (i == 0) {
document.write("<div id=\"schneedot"+ i +"\" style=\"position: ");
document.write("absolute; z-index: "+ i +"; visibility: ");
document.write("visible; top: 15px; left: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"schneedot"+ i +"\" style=\"position: ");
document.write("absolute; z-index: "+ i +"; visibility: ");
document.write("visible; top: 15px; left: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
}
}
function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
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("schneedot"+i).style.top = yp[i] + "px";
document.getElementById("schneedot"+i).style.left = (xp[i] + am[i]*Math.sin(dx[i])) + "px";
}
setTimeout("snowIE()", speed);
}
//-->
</script> |
|
↑
|
|
|
-
dein-lieblingsbuch
Premium
Wohnort: Berlin
|
04.11.2008 um 23:06 (UTC) Titel: |
|
|
Hi!!
Ja, ich habe das schon ersetzt und habe nun auch diesen Code
probiert, der mag auch nicht funktionieren . Langsam glaube ich
wirklich, dass der Schnee hinter dem Design fällt. |
|
↑
|
|
|
-
dein-lieblingsbuch
Premium
Wohnort: Berlin
|
05.11.2008 um 08:42 (UTC) Titel: |
|
|
Hi!!
Habe heute schon wieder einen anderen Code ausprobiert und kann immer
noch nichts sehen. Ich glaube ich lasse das mit dem Schnee, auch wenns schön aussieht... |
|
↑
|
|
|
-
sc-hassel-jugend
|
05.11.2008 um 08:51 (UTC) Titel: |
|
|
Setze den Code von Coolplace doch nochmal ein, dann kann man sehen woran es hapert |
|
↑
|
|
|
-
coolplace
Wohnort: USB = United States of Bücken
|
05.11.2008 um 09:43 (UTC) Titel: |
|
|
Ich habe das jetzt selber mal auf meiner Versuchshomepage ausprobiert und ich bin platt.
Ich habe mir noch mehrere Schneescripts angeschaut und ausprobiert, aber nicht eine Schneeflocke will fallen.
Die Scripte ansich funktionieren außerhalb des Baukastens, nur leider hier nicht, wedeer im IE noch im FF.
Ich werde mal nachforschen, woran es liegt. |
|
↑
|
|
|
-
coolplace
Wohnort: USB = United States of Bücken
|
06.11.2008 um 08:41 (UTC) Titel: |
|
|
Ich habe die Scripte jetzt noch mal in mehreren Browser getestet.
Hier ein Bericht, ob Schnee zu sehen ist oder nicht:
IE6 = Nein
IE7 = Ja
Opera = Ja
FF2 = Nein
FF3 = Nein
Safari = Nein
Netscape = Nein |
|
↑
|
|
|
-
dein-lieblingsbuch
Premium
Wohnort: Berlin
|
06.11.2008 um 09:41 (UTC) Titel: |
|
|
Na, das sind aber nicht viele Browser, die den Schneefallmodus unterstützen.
Danke, das du dir die Arbeit gemacht hast.
Kennst du vielleicht Homepages, wo uns Tools für
Weihnachten gibt - muss nicht Schneefallmodus sein?
Liebe Grüße |
|
↑
|
|
|
|