Página 1 de 2

Gifs Navideños

Publicado: 03 Dic 2006, 00:20
por sll88
Hola, como puedo hacer que mi web se llene de copos de nieve en movimiento y q vayan callendo?

Saludos y gracias.

Respuesta: Gifs Navideños

Publicado: 03 Dic 2006, 02:04
por SHARKILLO
ezo ya esta respondido incluso pusieron un codigo javascript ,no me acuerdo si the kuka o janu

Respuesta: Gifs Navideños

Publicado: 03 Dic 2006, 10:02
por xoom
Muevo el tema a Recursos

Respuesta: Gifs Navideños

Publicado: 03 Dic 2006, 13:07
por angelismo
Aqui tienes el codigo para poner nieve

Código: Seleccionar todo

<script>  
var no = 5; // snow number  
var speed = 15; // smaller number moves the snow faster  
var snowflake = "snow.gif";  
 
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 = 400, doc_height = 500;  
if (ns4up) {  
doc_width = self.innerWidth;  
doc_height = self.innerHeight;  
} else if (ie4up) {  
doc_width = 500;  
doc_height = 500;  
}  
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\" ");  
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() { // 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()", speed);  
}  
 
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()", speed);  
}  
 
if (ns4up) {  
snowNS();  
} else if (ie4up) {  
snowIE();  
}  
</script>
lo insertar en overall_header.tpl
donde pone snow.gif lo cambias por la url de la imagen del copo de nieve

Respuesta: Gifs Navideños

Publicado: 03 Dic 2006, 14:40
por Quecomo
Hola angelismo,

¿Se me escapa algo, no entiendo como puedo saber cual es la url que hay que poner en el lugar de snow.gif?

Respuesta: Gifs Navideños

Publicado: 03 Dic 2006, 15:01
por angelismo
tiene que ser la url de la imagen del copo de nieve

Respuesta: Gifs Navideños

Publicado: 03 Dic 2006, 18:20
por Quecomo
Lo único que veo es que en el firefox no funciona y en el IE me van cayendo pequeños imagenes que no se ven, como cuadrito blanco con cruz rojo. ¿Pero de donde saco la url?

Respuesta: Gifs Navideños

Publicado: 03 Dic 2006, 18:23
por angelismo
tienes que subir la imagen de un copo de nieve a un host de imagenes y coger la url

Respuesta: Gifs Navideños

Publicado: 03 Dic 2006, 20:15
por Quecomo
Gracias,

Ahora lo he entendido. :P

Respuesta: Gifs Navideños

Publicado: 06 Dic 2006, 00:25
por sll88
Como se puede hacr para q funcione en firefox? Como hago para que caigan mas copos? Es q solo cae uno cada 7 o 8 segundos.

Saludos y gracias.

Respuesta: Gifs Navideños

Publicado: 07 Dic 2006, 02:45
por sll88
Como se ponen estos copos http://www.weboweb.com/foro/

saludos y gracias.

Respuesta: Gifs Navideños

Publicado: 13 Dic 2006, 15:49
por Selena
En qué parte del overall_header.tpl se pone el código para el efecto copos de nieve???


Qué bonito está el forooooo!!! :bravo:

Respuesta: Gifs Navideños

Publicado: 13 Dic 2006, 17:27
por Selena
Aiiiiiins, no consigo que me salga :oops:

Yo quiero que me quede como en esta página http://www.weboweb.com/foro/

Sólo consigo que me salga 1 o dos copos que caen súper rápido.

Ayuda please :roll:

Respuesta: Gifs Navideños

Publicado: 13 Dic 2006, 20:03
por Zuker
Creo que el tema de como integrarlo seria mejor tratarlo en la seccion de phpbb

Esto es recursos webmaster

Respuesta: Gifs Navideños

Publicado: 13 Dic 2006, 21:26
por Selena
Emmmm, más arriba veo que sois vosotros los que lo habéis movido a Recursos Webmasters :roll:

Bueno decir que ya he conseguido algo con la ayuda de Class, un usuario de la web de Janu, pero aún no estoy satisfecha del resultado.

Los copos caen muy lentamente y muy pocos, a pesar de haberle dado los parámetros para que caigan más rápido y más copos. Además me lo ralentiza mucho.

Y lo que es peor, en Firefox no se ve.

Este es el código tal como lo tengo ahora.

La dire del foro: http://www.buenafuente.ws/Foro

A ver si se os ocurre como mejorarlo y sobre todo que se pueda ver en Firefox.

Código: Seleccionar todo

<script>
var no = 35; // snow number
var speed = 1; // smaller number moves the snow faster
var snowflake = "images/snow.gif";

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 = 900, doc_height = 700;
if (ns4up) {
  doc_width = self.innerWidth;
  doc_height = self.innerHeight;
} else if (ie4up) {
  doc_width = 900;
  doc_height = 700;
}
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 (ns4up) {                      // set layers
    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() {  // Netscape 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();
      doc_width = self.innerWidth;
      doc_height = self.innerHeight;
    }
    dx[i] += stx[i];
    document.layers["dot"+i].top = yp[i];
    document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
  }
  setTimeout("snowNS()", speed);
}

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();
      doc_width = document.body.clientWidth;
      doc_height = document.body.clientHeight;
    }
    dx[i] += stx[i];
    document.all["dot"+i].style.pixelTop = yp[i];
    document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
  }
  setTimeout("snowIE()", speed);
}

if (ns4up) {
  snowNS();
} else if (ie4up) {
  snowIE();
}
</script>