Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/02/2010, 12:49
Avatar de CHuLoSoY
CHuLoSoY
 
Fecha de Ingreso: febrero-2002
Ubicación: Ribeira (Galicia)
Mensajes: 1.900
Antigüedad: 22 años, 3 meses
Puntos: 29
Respuesta: Consulta de PHP

Mira un ejemplo:
Código PHP:
Ver original
  1. <html>
  2. <head>
  3. <script>
  4. function cambiaNoticia() {
  5.  
  6.       //Noticia actual:
  7.       var actual=document.getElementById("actual").value;
  8.       var siguiente=actual+1;
  9.  
  10.       document.getElementById("capa"+actual).style.display="none";
  11.       document.getElementById("capa"+siguiente).style.display="block";
  12.      
  13. setTimeout('cambiaNoticia()',15000) ; // volvemos a ejecutar la función tras 15 segundos
  14.  
  15. }</script>
  16. </head><body onload="cambiaNoticia();">
  17. <input type="hidden" id="actual" value="0">
  18. <div id="capa0">Prueba</DIV>
  19. <div id="capa1">NOTICIA 1</DIV>
  20. <div id="capa2">NOTICIA 2</div>
  21. <div id="capa3">NOTICIA 3</div>
  22.  
  23. </body>
  24. </html>

saludos
__________________
ESQUIO Dominios y Hosting
Las mejores características con los mejores precios.