项目作者: danielrohers

项目描述 :
Simple countdown
高级语言: JavaScript
项目地址: git://github.com/danielrohers/countdown.git
创建时间: 2017-09-04T18:10:18Z
项目社区:https://github.com/danielrohers/countdown

开源协议:

下载


countdown

Simple countdown

  1. var date = new Date();
  2. date.setMonth(date.getMonth() + 1);
  3. // start countdown with end time
  4. var countdown = new Countdown(date.getTime());
  5. // populate template DOM with ids: day, hour, minute, second, clock
  6. countdown.populate();
  7. // callback executed at each iteration
  8. countdown.time(function (days, hours, minutes, seconds) {
  9. ...
  10. });
  11. // callback executed at the end of countdown
  12. countdown.done = function () {
  13. ...
  14. };

Example template:

  1. <div id="clock">
  2. <span id="day"></span>
  3. <span id="hour"></span>
  4. <span id="minute"></span>
  5. <span id="second"></span>
  6. </div>