Advertisement
GangsterRik

refreshtimer

Jan 4th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>
  4. Countdown
  5. </title>
  6. <script type="text/javascript">
  7. var mins = 5;
  8. var secs = mins * 60;
  9. function countdown()
  10. {
  11. setTimeout('Decrement()',1000);
  12. }
  13. function Decrement()
  14. {
  15. if (document.getElementById)
  16. {
  17. minutes = document.getElementById("minutes");
  18. seconds = document.getElementById("seconds");
  19. if (seconds < 59)
  20. {
  21. seconds.value = secs;
  22. }
  23. else
  24. {
  25. minutes.value = getminutes();
  26. seconds.value = getseconds();
  27. }
  28. secs--;
  29. setTimeout('Decrement()',1000);
  30. }
  31. }
  32. function getminutes()
  33. {
  34. mins = Math.floor(secs / 60);
  35. return mins;
  36. }
  37. function getseconds()
  38. {
  39. return secs-Math.round(mins *60);
  40. }
  41. </script>
  42. </head>
  43.  
  44. <body>
  45. <div id="timer">
  46. <p style="color: #FFE87C; font-family: Arial, Helvetica; font-size:12px; ">
  47. De site herlaadt automatisch in
  48. <input id="minutes" type="text" style="width: 8px; font-family: Arial, Helvetica; color: #FFE87C; border: none; background:none; font-size: 12px; font-weight: bold;">
  49. :
  50. <input id="seconds" type="text" style="width: 16px; background:none; font-size: 12px; font-family: Arial, Helvetica; color: #FFE87C; border:none; font-weight: bold;">
  51. . Denk hieraan!
  52. </p>
  53. </div>
  54. <script>
  55. countdown();
  56. </script>
  57. </body>
  58. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement