Created
May 4, 2017 10:45
-
-
Save httpsterio/eb3ffae2c1a69e059e20bb84d0de1b67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function initializeClock(id, endtime) { | |
| var clock = document.getElementById(id); | |
| var timeinterval = setInterval(function() { | |
| var t = getTimeRemaining(endtime); | |
| clock.innerHTML = | |
| "days: " + | |
| t.days + | |
| "<br>" + | |
| "hours: " + | |
| t.hours + | |
| "<br>" + | |
| "minutes: " + | |
| t.minutes + | |
| "<br>" + | |
| "seconds: " + | |
| t.seconds; | |
| if (t.total <= 0) { | |
| clearInterval(timeinterval); | |
| } | |
| }, 1000); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment