Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setInterval(1000, countdownTimer);
- function globalButton() {
- document.getElementById("global").style.backgroundColor = "green";
- /*
- window.setTimeout(global_red_again, 5000);
- */
- timerReset();
- }
- function timerReset() {
- var countdown = new Date();
- var now = new Date().getTime();
- var countdown20 = countdown.getTime() + 1200000;
- window.distance = countdown20 - now;
- countdownTimer();
- }
- function countdownTimer() {
- var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
- var seconds = Math.floor((distance % (1000 * 60)) / 1000);
- if (seconds < 10) {
- document.getElementById("globalTimer").innerHTML = minutes + ":0" + seconds;
- }
- else {
- document.getElementById("globalTimer").innerHTML = minutes + ":" + seconds;
- }
- }
- /*function global_red_again() {
- document.getElementById("global").style.backgroundColor = "red";
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement