Conteo regresivo 1


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <SCRIPT language=JavaScript>
  2. <!--
  3. var eventdate = new Date("December 31, 2010 23:59:59 CDT"); <---////Ejemplo de fecha///Manuellujan////
  4.  
  5. function toSt(n) {
  6. s=""
  7. if(n<10) s+="0"
  8. return s+n.toString();
  9. }
  10.  
  11. function countdown() {
  12. cl=document.clock;
  13. d=new Date();
  14. count=Math.floor((eventdate.getTime()-d.getTime())/1000);
  15. if(count<=0)
  16. {cl.days.value ="----";
  17. cl.hours.value="--";
  18. cl.mins.value="--";
  19. cl.secs.value="--";
  20. return;
  21. }
  22. cl.secs.value=toSt(count%60);
  23. count=Math.floor(count/60);
  24. cl.mins.value=toSt(count%60);
  25. count=Math.floor(count/60);
  26. cl.hours.value=toSt(count%24);
  27. count=Math.floor(count/24);
  28. cl.days.value=count;
  29.  
  30. setTimeout("countdown()",500);
  31. }
  32. // end hiding script-->
  33.  
  34. </SCRIPT>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.