Pure JavaScript Digital Countdown Timer – Countdown Module

Category: Date & Time , Javascript | August 7, 2018
Author: ievgenborodin
Views Total: 4,856
Official Page: Go to website
Last Update: August 7, 2018
License: MIT

Preview:

Pure JavaScript Digital Countdown Timer – Countdown Module

Description:

Countdown Module is a pure JavaScript library that uses CSS animations to create a beautiful, 7-segment digital countdown timer for your web app.

How to use it:

Load the stylesheet countdown.css in the head section and the JavaScript countdown.js at the end of the html document.

<link rel="stylesheet" href="countdown.css">
<script src="countdown.js"></script>

Create a DIV element that will be served as the container for your countdown timer.

<div id="demo"> 
</div>

Create a new countdown timer instance.

var countdown = new Countdown({
    wrapId: 'demo', // countdown selector
    seconds: 71, // time to countdown from
});

Execute a callback when the countdown is completed.

var countdown = new Countdown({
    wrapId: 'myDiv',
    seconds: 71,
    callback: callback
});
  
function callback(){
  // do something ...
};

Changelog:

08/07/2018

  • set seconds by date

You Might Be Interested In:


Leave a Reply