Ver Mensaje Individual
  #7 (permalink)  
Antiguo 11/06/2012, 19:06
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 9 meses
Puntos: 1567
Respuesta: Conteo regresivo con solo de minutos y segundos, sin tomar hora del sistem

sería algo asi

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript">
  7. //<![CDATA[
  8. // 1000 = 1 segundo
  9. var mins = 59;
  10. var segs = 59;
  11. var s;
  12. function minutos(){
  13. document.getElementById("minutos").innerHTML=mins;
  14. if(mins == 0){
  15. var dm = clearInterval(m);
  16. s = setInterval('segundos()', 1000);
  17. }
  18. mins--;
  19. }
  20.  
  21. function segundos(){
  22. document.getElementById("segundos").innerHTML=segs;
  23. if(segs == 0){
  24. location.reload();
  25. var ds = clearInterval(s);
  26. }
  27. segs--;
  28. }
  29.  
  30. var m = setInterval('minutos()', 1000);
  31.  
  32. //]]>
  33. </head>
  34. <span id="minutos">60</span> : <span id="segundos">00</span>
  35. </body>
  36. </html>

En el ejemplo puse 1000 para el setInterval de la función minutos, solo a los efectos de que la pruebes, debería ser en realidad 60000 (60 segundos)

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.