Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>
- Countdown
- </title>
- <script type="text/javascript">
- var mins = 5;
- var secs = mins * 60;
- function countdown()
- {
- setTimeout('Decrement()',1000);
- }
- function Decrement()
- {
- if (document.getElementById)
- {
- minutes = document.getElementById("minutes");
- seconds = document.getElementById("seconds");
- if (seconds < 59)
- {
- seconds.value = secs;
- }
- else
- {
- minutes.value = getminutes();
- seconds.value = getseconds();
- }
- secs--;
- setTimeout('Decrement()',1000);
- }
- }
- function getminutes()
- {
- mins = Math.floor(secs / 60);
- return mins;
- }
- function getseconds()
- {
- return secs-Math.round(mins *60);
- }
- </script>
- </head>
- <body>
- <div id="timer">
- <p style="color: #FFE87C; font-family: Arial, Helvetica; font-size:12px; ">
- De site herlaadt automatisch in
- <input id="minutes" type="text" style="width: 8px; font-family: Arial, Helvetica; color: #FFE87C; border: none; background:none; font-size: 12px; font-weight: bold;">
- :
- <input id="seconds" type="text" style="width: 16px; background:none; font-size: 12px; font-family: Arial, Helvetica; color: #FFE87C; border:none; font-weight: bold;">
- . Denk hieraan!
- </p>
- </div>
- <script>
- countdown();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement