https://github.com/danielrohers/countdown
Simple countdown
https://github.com/danielrohers/countdown
countdown javascript
Last synced: 9 months ago
JSON representation
Simple countdown
- Host: GitHub
- URL: https://github.com/danielrohers/countdown
- Owner: danielrohers
- Created: 2017-09-04T18:10:18.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-04T18:29:11.000Z (almost 9 years ago)
- Last Synced: 2025-08-13T19:39:58.331Z (10 months ago)
- Topics: countdown, javascript
- Language: JavaScript
- Homepage: https://danielrohers.com/countdown/
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# countdown
Simple countdown
```js
var date = new Date();
date.setMonth(date.getMonth() + 1);
// start countdown with end time
var countdown = new Countdown(date.getTime());
// populate template DOM with ids: day, hour, minute, second, clock
countdown.populate();
// callback executed at each iteration
countdown.time(function (days, hours, minutes, seconds) {
...
});
// callback executed at the end of countdown
countdown.done = function () {
...
};
```
Example template:
```html
```