Foros del Web » Soporte técnico » Ayuda General »

Cómo se rotan los banners? URGENTE

Estas en el tema de Cómo se rotan los banners? URGENTE en el foro de Ayuda General en Foros del Web. El nombre de archivo del primer banner es jordan.gif y el del segundo es perry.gif Exactamente, qué código HTML tengo que poner para que esos ...
  #1 (permalink)  
Antiguo 10/09/2002, 12:43
 
Fecha de Ingreso: febrero-2002
Mensajes: 26
Antigüedad: 22 años, 2 meses
Puntos: 0
Cómo se rotan los banners? URGENTE

El nombre de archivo del primer banner es jordan.gif y el del segundo es perry.gif

Exactamente, qué código HTML tengo que poner para que esos dos banners roten?

Necesito una respuesta rápida. Gracias por adelantado.
  #2 (permalink)  
Antiguo 10/09/2002, 15:12
 
Fecha de Ingreso: enero-2002
Mensajes: 545
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: Cómo se rotan los banners? URGENTE

Prueba esto, cada vez que entren en la web aparecera uno. Espero que te sirva




<!-- Copiar dentro del tag BODY -->

<script language="javascript">

<!--
function VecImagenes()
{
n=0;
this[n++]="jordan.gif";
this[n++]="perru.gif";
this[n++]="03.jpg"
this.N=n;
}
var Imagenes=new VecImagenes();
src= Imagenes[ Math.floor(Math.random() * Imagenes.N) ] ;
document.write("<IMG SRC="+src+">");
//-->

</script>



<p align="center"><a href="http://www.mundopesca.cjb.net"><img border="0" src="http://usuarios.lycos.es/criminologia/antinazis.gif" width="65" height="81"></a></p>
  #3 (permalink)  
Antiguo 10/09/2002, 18:37
Avatar de clak  
Fecha de Ingreso: noviembre-2001
Ubicación: Zacatecas, Zac.
Mensajes: 747
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Cómo se rotan los banners? URGENTE

Código:
  
&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;
&lt;!-- Begin
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
txt=&quot;Ingrese al web de Banner1&quot;;
url=&quot;http://www.banner1.com&quot;;
alt=&quot;Banner1.com&quot;;
banner=&quot;images/banner1.gif&quot;;
width=&quot;468&quot;;
height=&quot;60&quot;;
}
if (ad==2) {
txt=&quot;Ingrese al web de Banner2&quot;;
url=&quot;http://www.banner2.com&quot;;
alt=&quot;Banner2.com&quot;;
banner=&quot;images/banner2.gif&quot;;
width=&quot;468&quot;;
height=&quot;60&quot;;
}
if (ad==3) {
txt=&quot;Ingrese al web de Banner3&quot;;
url=&quot;http://www.banner3.com&quot;;
alt=&quot;Banner3.com&quot;;
banner=&quot;images/banner3.gif&quot;;
width=&quot;468&quot;;
height=&quot;60&quot;;
}
document.write('&lt;center&gt;');
document.write('&lt;a href=\&quot;' + url + '\&quot; target=\&quot;_blank\&quot;&gt;');
document.write('&lt;img src=\&quot;' + banner + '\&quot; width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\&quot;' + alt + '\&quot; border=0&gt;&lt;br&gt;');
document.write('&lt;small&gt;' + txt + '&lt;/small&gt;&lt;/a&gt;');
document.write('&lt;/center&gt;');
// End --&gt;
&lt;/SCRIPT&gt;
Si quieres agregar más banners dodne dice var how_many_ads = 3; ahi le cambias a 4 o 5 o 6 y sigeues agregando pero cuando argeges te fijas que tambien lleven la secuencia de numeros, por ejemplo:
if (ad==4) { y asi sucesivamente, saludos...


<a href="http://www.webrecurso.com" target="_blank"><img src="http://www.webrecurso.com/banners_wr/wr_88x31_4.gif" border="0"></a>
  #4 (permalink)  
Antiguo 11/09/2002, 10:04
 
Fecha de Ingreso: febrero-2002
Mensajes: 26
Antigüedad: 22 años, 2 meses
Puntos: 0
Re: Cómo se rotan los banners? URGENTE

Muchas gracias. Voy a comprobar si funciona.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:16.