Nevica Nel Forum

Pagine: [1], 2
maldini
00lunedì 12 dicembre 2005 15:26
l'ho trovato su un forum nostro iscritto e mi sembra un effetto carino
codice da inserire nel tag di inizio pagina

<script>

// If you use this JavaScript SNOW in your own web pages,
// please sent a note to snow@altan.hr.
//
// JS Snow v0.1
// finished on 11-10-1999 23:04 in Zagreb, Croatia.
//
// Copyright 1999 Altan d.o.o.
// www.altan.hr/
// www.altan.hr/snow/index.html
// modified by aengelus74

var no = 12; // snow number

var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;

var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 800, doc_height = 600;

if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
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; // set coordinate variables
xp = Math.random()*(doc_width-50); // set position variables
yp = Math.random()*doc_height;
am = Math.random()*20; // set amplitude variables
stx = 0.02 + Math.random()/12; // set step variables
sty = 0.7 + Math.random(); // set step variables
if (ns4up) { // set layers
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><a href=\"http://my.netian.com/~charmjin\"><img src=\"http://habeascorpus.altervista.org/_altervista_ht/dot.gif\" border=\"0\"></a></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\"http://habeascorpus.altervista.org/_altervista_ht/dot.gif\" border=\"0\"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://any.to/mirror\"><img src=\"http://habeascorpus.altervista.org/_altervista_ht/dot.gif\" border=\"0\"></a></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src=\"http://habeascorpus.altervista.org/_altervista_ht/dot.gif\" border=\"0\"></div>");
}
}
}

function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
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("snowNS()", 12);
}

function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
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()", 12);
}

if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}

</script>
King.Arthur
00lunedì 12 dicembre 2005 18:27
Non funge... [SM=g27820]:
Crystalmoon
00lunedì 12 dicembre 2005 18:36
posto altri 2 effetti "neve" li ho provati e fungono [SM=g27828]
da inserire nell'html o della singola cartella o di tutto un forum [SM=g27811]



<SCRIPT LANGUAGE="JavaScript1.2">

<!-- Begin
var no = 12; // numero de imagens
var speed = 5; // smaller number moves the hearts faster
var heart = "http://www.vickys01.land.ru/scripts/neve.gif";
var flag;
var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;

var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 800, doc_height = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
amx = new Array();
amy = new Array();
stx = new Array();
sty = new Array();
flag = new Array();
for (i = 0; i < no; ++ i) {
dx = 0; // set coordinate variables
xp = Math.random()*(doc_width-30)+10; // set position variables
yp = Math.random()*doc_height;
amy = 12+ Math.random()*20; // set amplitude variables
amx = 10+ Math.random()*40;
stx = 0.02 + Math.random()/10; // set step variables
sty = 0.7 + Math.random(); // set step variables
flag = (Math.random()>0.5)?1:0;
if (ns4up) { // set layers
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(heart+ "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(heart+ "\" border=\"0\"></layer>");
}
} else
if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(heart+ "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(heart+ "\" border=\"0\"></div>");
}
}
}

function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
if (yp > doc_height-50) {
xp = 10+ Math.random()*(doc_width-amx-30);
yp = 0;
flag=(Math.random()<0.5)?1:0;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
if (flag)
dx += stx;
else
dx -= stx;
if (Math.abs(dx) > Math.PI) {
yp+=Math.abs(amy*dx);
xp+=amx*dx;
dx=0;
flag=!flag;
}
document.layers["dot"+i].top = yp + amy*(Math.abs(Math.sin(dx)+dx));
document.layers["dot"+i].left = xp + amx*dx;

}
setTimeout("snowNS()", speed);
}

function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
if (yp > doc_height-50) {
xp = 10+ Math.random()*(doc_width-amx-30);
yp = 0;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();
flag=(Math.random()<0.5)?1:0;
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
if (flag)
dx += stx;
else
dx -= stx;
if (Math.abs(dx) > Math.PI) {
yp+=Math.abs(amy*dx);
xp+=amx*dx;
dx=0;
flag=!flag;
}

document.all["dot"+i].style.pixelTop = yp + amy*(Math.abs(Math.sin(dx)+dx));
document.all["dot"+i].style.pixelLeft = xp + amx*dx;
}
setTimeout("snowIE()", speed);
}

if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
// End -->
</script>
Crystalmoon
00lunedì 12 dicembre 2005 18:37
ed ecco il secondo.. non so se è uguale a quello di maldini.. non ho avuto il tempo x controllare il suo.. cmq lo posto e funziona di sicuro anche questo xchè l'ho testato [SM=g27811]



SCRIPT>
// Prelevato ed illustrato su www.web-link.it
// CREDITS:
// Snowmaker
// By Peter Gehrig
// Copyright (c) 2003 Peter Gehrig. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at www.24fun.com
// info@24fun.com
// 11/27/2003

// IMPORTANT:
// If you add this script to a script-library or script-archive
// you have to add a highly visible link to
// www.24fun.com on the webpage
// where this script will be featured

///////////////////////////////////////////////////////////////////////////
// CONFIGURATION STARTS HERE
///////////////////////////////////////////////////////////////////////////

// Set the number of snowflakes (more than 30 - 40 not recommended)
var snowmax=50

// Set the colors for the snow. Add as many colors as you like
var snowcolor=new Array("#ffffff","#ffffff","#ffffff")

// Set the fonts, that create the snowflakes. Add as many fonts as you like
var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS")

// Set the letter that creates your snowflake (recommended:*)
var snowletter="*"

// Set the speed of sinking (recommended values range from 0.3 to 2)
var sinkspeed=0.6

// Set the maximal-size of your snowflaxes
var snowmaxsize=22

// Set the minimal-size of your snowflaxes
var snowminsize=8

// Set the snowing-zone
// Set 1 for all-over-snowing, set 2 for left-side-snowing
// Set 3 for center-snowing, set 4 for right-side-snowing
var snowingzone=1

///////////////////////////////////////////////////////////////////////////
// CONFIGURATION ENDS HERE
///////////////////////////////////////////////////////////////////////////


// Do not edit below this line
var snow=new Array()
var marginbottom
var marginright
var timer
var i_snow=0
var x_mv=new Array();
var crds=new Array();
var lftrght=new Array();
var browserinfos=navigator.userAgent
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
var ns6=document.getElementById&&!document.all
var opera=browserinfos.match(/Opera/)
var browserok=ie5||ns6||opera

function randommaker(range) {
rand=Math.floor(range*Math.random())
return rand
}

function initsnow() {
if (ie5 || opera) {
marginbottom = document.body.clientHeight
marginright = document.body.clientWidth
}
else if (ns6) {
marginbottom = window.innerHeight
marginright = window.innerWidth
}
var snowsizerange=snowmaxsize-snowminsize
for (i=0;i<=snowmax;i++) {
crds = 0;
lftrght = Math.random()*15;
x_mv = 0.03 + Math.random()/10;
snow=document.getElementById("s"+i)
snow.style.fontFamily=snowtype[randommaker(snowtype.length)]
snow.size=randommaker(snowsizerange)+snowminsize
snow.style.fontSize=snow.size
snow.style.color=snowcolor[randommaker(snowcolor.length)]
snow.sink=sinkspeed*snow.size/5
if (snowingzone==1) {snow.posx=randommaker(marginright-snow.size)}
if (snowingzone==2) {snow.posx=randommaker(marginright/2-snow.size)}
if (snowingzone==3) {snow.posx=randommaker(marginright/2-snow.size)+marginright/4}
if (snowingzone==4) {snow.posx=randommaker(marginright/2-snow.size)+marginright/2}
snow.posy=randommaker(2*marginbottom-marginbottom-2*snow.size)
snow.style.left=snow.posx
snow.style.top=snow.posy
}
movesnow()
}

function movesnow() {
for (i=0;i<=snowmax;i++) {
crds += x_mv;
snow.posy+=snow.sink
snow.style.left=snow.posx+lftrght*Math.sin(crds);
snow.style.top=snow.posy

if (snow.posy>=marginbottom-2*snow.size || parseInt(snow.style.left)>(marginright-3*lftrght)){
if (snowingzone==1) {snow.posx=randommaker(marginright-snow.size)}
if (snowingzone==2) {snow.posx=randommaker(marginright/2-snow.size)}
if (snowingzone==3) {snow.posx=randommaker(marginright/2-snow.size)+marginright/4}
if (snowingzone==4) {snow.posx=randommaker(marginright/2-snow.size)+marginright/2}
snow.posy=0
}
}
var timer=setTimeout("movesnow()",50)
}

for (i=0;i<=snowmax;i++) {
document.write(""+snowletter+"")
}
if (browserok) {
window.onload=initsnow
}
</script>
maldini
00lunedì 12 dicembre 2005 18:41
a me funziona anke il mio cmq... neve per neve prendete quello ke vi va meglio [SM=x611888]
Crystalmoon
00lunedì 12 dicembre 2005 18:46
Re:

Scritto da: maldini 12/12/2005 18.41
a me funziona anke il mio cmq... neve per neve prendete quello ke vi va meglio [SM=x611888]



infatti ora ho provato mi funge anche il tuo [SM=g27828]

vabbè hanno piu scelta [SM=x611856]
maldini
00lunedì 13 novembre 2006 16:26
Trovato da sissy, abb simile agli altri e altrettanto funzionante
<script>
// Prelevato ed illustrato su web-link.it
// CREDITS:
// Snowmaker
// By Peter Gehrig
// Copyright (c) 2003 Peter Gehrig. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at www.24fun.com
// info@24fun.com
// 11/27/2003

// IMPORTANT:
// If you add this script to a script-library or script-archive
// you have to add a highly visible link to
// www.24fun.com on the webpage
// where this script will be featured

///////////////////////////////////////////////////////////////////////////
// CONFIGURATION STARTS HERE
///////////////////////////////////////////////////////////////////////////

// Set the number of snowflakes (more than 30 - 40 not recommended)
var snowmax=35

// Set the colors for the snow. Add as many colors as you like
var snowcolor=new Array("#aaaacc","#ddddFF","#ccccDD")

// Set the fonts, that create the snowflakes. Add as many fonts as you like
var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS")

// Set the letter that creates your snowflake (recommended:*)
var snowletter="*"

// Set the speed of sinking (recommended values range from 0.3 to 2)
var sinkspeed=0.6

// Set the maximal-size of your snowflaxes
var snowmaxsize=22

// Set the minimal-size of your snowflaxes
var snowminsize=8

// Set the snowing-zone
// Set 1 for all-over-snowing, set 2 for left-side-snowing
// Set 3 for center-snowing, set 4 for right-side-snowing
var snowingzone=3

///////////////////////////////////////////////////////////////////////////
// CONFIGURATION ENDS HERE
///////////////////////////////////////////////////////////////////////////


// Do not edit below this line
var snow=new Array()
var marginbottom
var marginright
var timer
var i_snow=0
var x_mv=new Array();
var crds=new Array();
var lftrght=new Array();
var browserinfos=navigator.userAgent
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
var ns6=document.getElementById&&!document.all
var opera=browserinfos.match(/Opera/)
var browserok=ie5||ns6||opera

function randommaker(range) {
rand=Math.floor(range*Math.random())
return rand
}

function initsnow() {
if (ie5 || opera) {
marginbottom = document.body.clientHeight
marginright = document.body.clientWidth
}
else if (ns6) {
marginbottom = window.innerHeight
marginright = window.innerWidth
}
var snowsizerange=snowmaxsize-snowminsize
for (i=0;i<=snowmax;i++) {
crds = 0;
lftrght = Math.random()*15;
x_mv = 0.03 + Math.random()/10;
snow=document.getElementById("s"+i)
snow.style.fontFamily=snowtype[randommaker(snowtype.length)]
snow.size=randommaker(snowsizerange)+snowminsize
snow.style.fontSize=snow.size
snow.style.color=snowcolor[randommaker(snowcolor.length)]
snow.sink=sinkspeed*snow.size/5
if (snowingzone==1) {snow.posx=randommaker(marginright-snow.size)}
if (snowingzone==2) {snow.posx=randommaker(marginright/2-snow.size)}
if (snowingzone==3) {snow.posx=randommaker(marginright/2-snow.size)+marginright/4}
if (snowingzone==4) {snow.posx=randommaker(marginright/2-snow.size)+marginright/2}
snow.posy=randommaker(2*marginbottom-marginbottom-2*snow.size)
snow.style.left=snow.posx
snow.style.top=snow.posy
}
movesnow()
}

function movesnow() {
for (i=0;i<=snowmax;i++) {
crds += x_mv;
snow.posy+=snow.sink
snow.style.left=snow.posx+lftrght*Math.sin(crds);
snow.style.top=snow.posy

if (snow.posy>=marginbottom-2*snow.size || parseInt(snow.style.left)>(marginright-3*lftrght)){
if (snowingzone==1) {snow.posx=randommaker(marginright-snow.size)}
if (snowingzone==2) {snow.posx=randommaker(marginright/2-snow.size)}
if (snowingzone==3) {snow.posx=randommaker(marginright/2-snow.size)+marginright/4}
if (snowingzone==4) {snow.posx=randommaker(marginright/2-snow.size)+marginright/2}
snow.posy=0
}
}
var timer=setTimeout("movesnow()",50)
}

for (i=0;i<=snowmax;i++) {
document.write("<span id='s"+i+"' style='position:absolute;top:-"+snowmaxsize+"'>"+snowletter+"</span>")
}
if (browserok) {
window.onload=initsnow
}
</script>
Nimueh
00lunedì 13 novembre 2006 17:42
Ciao, buona serata.
Solito problema. nemmeno uno di questi va con Firefox, li ho provati tutti. Ce ne sono due uguali.... Quello di Sissy era già stato postato da Crystalmoon...
maldini
00lunedì 13 novembre 2006 17:52
ha solo alcune piccole differenze
quanto a firefox nn so quali possano andare bene
proverò a cercarne
Nimueh
00lunedì 13 novembre 2006 21:03
Re:

Scritto da: maldini 13/11/2006 17.52
ha solo alcune piccole differenze
quanto a firefox nn so quali possano andare bene
proverò a cercarne



Mi sa che ne ho trovato uno.... Ora lo provo e vi dico...
Nimueh
00lunedì 13 novembre 2006 22:11
Era una applet che rallentava tutto, l'ho levata....
maldini
00lunedì 13 novembre 2006 23:28
io ne ho trovati un paio però son complessi da usare per un forum
Nimueh
00martedì 14 novembre 2006 13:26
Re:

Scritto da: maldini 13/11/2006 23.28
io ne ho trovati un paio però son complessi da usare per un forum




Perchè complessi?
Postali, sono curiosa di vederli..
=PowerBoy=
00martedì 14 novembre 2006 14:46
Io ho le palle nel mio forum... [SM=x611841]

Nel senso che sono palline di Natale!!!
@Orchidea@
00martedì 14 novembre 2006 16:17
L'effetto neve e molto bello!!
maldini
00martedì 14 novembre 2006 16:37
Re: Re:


Scritto da: Nimueh 14/11/2006 13.26



Perchè complessi?
Postali, sono curiosa di vederli..



complessi da scrivere xkè nn ho ancora trovato come si legano ai file [SM=x611817]
appena trovo il punto giusto del codice si semplifica tutto [SM=x611912]

non ho avuto molto tempo di indagare
sissy66
00martedì 14 novembre 2006 19:29
Nimueh...quello che ho trovato non è come quello di Crystalmoon...il suo ha le palle di neve che sono piuì grandi e scendono una ad una quello che ho trovato è proprio come un cielo carico di neve...molto delicato...carino carino, io l'ho messo nella sezione natalizia [SM=g27823]
maldini
00martedì 14 novembre 2006 19:46
sissy
ho studiato il tuo codice
con quello la neve ti cade solo al centro della pagina
per farlo cadere in tutto il forum
devi modificare una voce

prendo anche la parte con le / xkè cosi vedi subito dovè


var snowingzone=3

///////////////////////////////////////////////////////////////////////////
// CONFIGURATION ENDS HERE
///////////////////////////////////////////////////////////////////////////


per mettere la neve in tutto il forum devi scrivere
var snowingzone=1
invece di =3
[SM=g27823]
Nimueh
00martedì 14 novembre 2006 22:30
Re:

Scritto da: sissy66 14/11/2006 19.29
Nimueh...quello che ho trovato non è come quello di Crystalmoon...il suo ha le palle di neve che sono piuì grandi e scendono una ad una quello che ho trovato è proprio come un cielo carico di neve...molto delicato...carino carino, io l'ho messo nella sezione natalizia [SM=g27823]



Sissina, io sono stata nella sezione natalizia del tuo forum, ma non lo vedo :(

Sono malata di firefox, se gli script che metto passano inosservati a chi ha firefox è inutile [SM=g27813] [SM=g27813]
maldini
00martedì 14 novembre 2006 22:31
Re: Re:

Scritto da: Nimueh 14/11/2006 22.30


Sissina, io sono stata nella sezione natalizia del tuo forum, ma non lo vedo :(

Sono malata di firefox, se gli script che metto passano inosservati a chi ha firefox è inutile [SM=g27813] [SM=g27813]

il suo lo vedo con firefox... però io ho il 2.0
Nimueh
00martedì 14 novembre 2006 22:54
Anche io ho la 2.0.... ma ho gli java disabilitati..... boh, provo a vedere dopo...
maldini
00martedì 14 novembre 2006 22:56
[SM=x611841] ma allora non sei furba... se disabiliti gli script hai voglia di vederla la neve.....
Nimueh
00mercoledì 15 novembre 2006 03:19
Palline di Natale che salgono
<script type="text/javascript" language="JavaScript1.2"> <!-- Begin
var no = 9; // image number or falling rate
var speed = 20; // the lower the number the faster the image moves
var snow = new Array();
snow[0] = "http://stronginvision.interfree.it/pallina1.gif"
snow[1] = "http://stronginvision.interfree.it/pallina2.gif"
snow[2] = "http://stronginvision.interfree.it/pallina3.gif"
snow[3] = "http://stronginvision.interfree.it/pallina4.gif"
snow[4] = "http://stronginvision.interfree.it/pallina5.gif"
var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 800, doc_height = 1800;

if (ns4up||ns6up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
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();
j = 0;

for (i = 0; i < no; ++ i) {
dx = 0; // set coordinate variables
xp = Math.random()*(doc_width-50); // set position variables
yp = Math.random()*doc_height;
am = Math.random()*20; // set amplitude variables
stx = 0.02 + Math.random()/10; // set step variables
sty = 0.7 + Math.random(); // set step variables
if (ns4up) { // set layers
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\""+ snow[j] + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\""+ snow[j] + "\" border=\"0\"></layer>");
} } else if (ie4up||ns6up) { if (i == 0)
{
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"VISIBILITY: visible; TOP: 15px; LEFT: 15px; width:1;\"><img src=\"" + snow[j] + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"VISIBILITY: visible; TOP: 15px; LEFT: 15px; width:1;\"><img src=\"" + snow[j] + "\" border=\"0\"></div>");
}
}
if (j == (snow.length-1)) { j = 0; } else { j += 1; }
}

function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp -= sty; if (yp < -50) {
xp = Math.random()*(doc_width-am-30);
yp = doc_height;
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+pageYOffset;
document.layers["dot"+i].left = xp +
am*Math.sin(dx);
}
setTimeout("snowNS()", speed);
}

function snowIE_NS6() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp -= sty;
if (yp < -50) {
xp = Math.random()*(doc_width-am-30);
yp = doc_height;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();
doc_width = ns6up?window.innerWidth-5:document.body.clientWidth;
doc_height = ns6up?window.innerHeight-5:document.body.clientHeight;
}
dx += stx;
if (ie4up){
document.all["dot"+i].style.pixelTop = yp+document.body.scrollTop;
document.all["dot"+i].style.pixelLeft = xp + am*Math.sin(dx);
}
else if (ns6up){
document.getElementById("dot"+i).style.top=yp+pageYOffset;
document.getElementById("dot"+i).style.left=xp + am*Math.sin(dx);
}
}
setTimeout("snowIE_NS6()", speed);
}

if (ns4up) {
snowNS();
} else if (ie4up||ns6up) {
snowIE_NS6();
}
// End -->

</script>


Funziona anche con FireFox!!
Modificato da Nimueh 15/11/2006 3.19
Nimueh
00mercoledì 15 novembre 2006 03:21
Effetto neve (media/fiocco)
<!--webbot bot=HTMLMarkup startspan -->
<script type="text/javascript" language="JavaScript1.2"> //Configure below to change URL path to the snow image
var snowsrc="http://stronginvision.interfree.it/pallinabianca.gif"
// Configure below to change number of snow to render
var no = 10;

var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;

var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 800, doc_height = 600;

if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
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; // set coordinate variables
xp = Math.random()*(doc_width-50); // set position variables
yp = Math.random()*doc_height;
am = Math.random()*20; // set amplitude variables
stx = 0.02 + Math.random()/10; // set step variables
sty = 0.7 + Math.random(); // set step variables
if (ns4up) { // set layers
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><a href=\"http://dynamicdrive.com/\"><img src='"+snowsrc+"' border=\"0\"></a></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://dynamicdrive.com\"><img src='"+snowsrc+"' border=\"0\"></a></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"></div>");
}
}
}

function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
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("snowNS()", 10);
}

function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
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);
}

if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}

/* prelevato su http://www.grafikat.it */

</script><!--webbot bot="HTMLMarkup" endspan -->
Nimueh
00mercoledì 15 novembre 2006 03:23
Effetto neve (grossa/fiocco)
<script type="text/javascript"> <!--
var no = 15;
var speed = 2;
var snowflake = "http://stronginvision.interfree.it/fiocco.gif";

var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp;
var am, stx, sty;
var i, doc_width = 800, doc_height = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
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 (ns4up) {
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ 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=\"dot"+ 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 snowNS() {
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("snowNS()", speed);
}
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()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
// -->
</script>
maldini
00mercoledì 15 novembre 2006 11:19
preciso una cosa

in tutti questi codici è possibile cambiare l'oggetto che cade (o sale)
ad esempio mettendo zucche ad halloween, calze all'epifania, sassi... qualunque cosa insomma
basta cambiare il riferimento all'immagine oggetto della caduta
sissy66
00mercoledì 15 novembre 2006 12:52
Mi dici dove devo mettere il soggetto? Volevo mettere dei pipistrelli nella sezione di halloween ma non ci capisco praticamente niente [SM=g27823]
maldini
00mercoledì 15 novembre 2006 13:05
di solito all'inizio del codice è una parte in cui viene caricata l'immagine

la riconosci xkè è l'indirizzo di una gif

www.sito.it/immagine.gif

basta che sostituisci l'indirizzo attuale con quello del pipistrello
@Orchidea@
00giovedì 30 novembre 2006 20:53
caspita abbiamo l'imbarazzo della scelta [SM=x611945]
@Orchidea@
00martedì 5 dicembre 2006 22:12
non mi funziona nessuno di questi [SM=x611831] [SM=x611831] dannato html
Questa è la versione 'lo-fi' del Forum Per visualizzare la versione completa clicca qui
Tutti gli orari sono GMT+01:00. Adesso sono le 22:41.
Copyright © 2000-2024 FFZ srl - www.freeforumzone.com