Ver Mensaje Individual
  #5 (permalink)  
Antiguo 12/02/2010, 23:03
repo316
 
Fecha de Ingreso: febrero-2010
Mensajes: 48
Antigüedad: 14 años, 2 meses
Puntos: 0
Respuesta: Consulta de PHP

Cita:
Iniciado por CHuLoSoY Ver Mensaje
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
lo intenté pero no me funcionó :S