Foros del Web » Programando para Internet » Javascript »

Rotador de banner

Estas en el tema de Rotador de banner en el foro de Javascript en Foros del Web. Amigos del foro, he encontrado este código que me es de mucha necesidad y funciona muy bien. El problema es que soy totalmente ignorante en ...
  #1 (permalink)  
Antiguo 05/05/2009, 11:34
 
Fecha de Ingreso: julio-2008
Mensajes: 18
Antigüedad: 15 años, 9 meses
Puntos: 0
Rotador de banner

Amigos del foro, he encontrado este código que me es de mucha necesidad y funciona muy bien. El problema es que soy totalmente ignorante en el lenguaje javascript. El código muestra un banner distinto cada vez que se abre la página. Sin embargo yo necesito que los banner se muestren uno por uno cada dos segundo por ejemplo. Ojalá alguien pueda ayudarme.
Desde ya mi agradecimiento por prestar atención al tema.

<html>
<head>
<title>Rotar banners</title>
</head>
<body>
<script language="JavaScript">
<!--

var cuantosbanners = 3 ;
var ahora = new Date()
var segundos = ahora.getSeconds()
var banner = segundos % cuantosbanners;
banner +=1;

if (banner==1) {
texto=" Entra en la web de banner1 ";
url=" web a donde apunta el enlace ";
alt=" Texto alternativo1 ";
imagen=" imagenes/banner1.gif ";
width=" 468 ";
height=" 60 ";
}
if (banner==2) {
texto=" Entra en la web de banner2 ";
url=" web a donde apunta el enlace ";
alt=" Texto alternativo2 ";
imagen=" imagenes/banner2.gif ";
width=" 468 ";
height=" 60 ";
}
if (banner==3) {
texto=" Entra en la web de banner3 ";
url=" web a donde apunta el enlace ";
alt=" Texto alternativo3 ";
imagen=" imagenes/banner3.gif ";
width=" 468 ";
height=" 60 ";
}

document.write('<center>');
document.write('<a href="' + url + '" target="_blank">');
document.write('<img src="' + imagen + '" width=')
document.write( width + ' height=' + height + ' ');
document.write('alt="' + alt + '" border=0><br>');
document.write('<small>' + texto + '</small></a>');
document.write('</center>');

//-->
</script>

</body>
</html>
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 13:22.