Creating A Simple Digital Countdown Timer with timerJS

Category: Date & Time , Javascript | January 1, 2014
Author: tcha-tcho
Views Total: 2,407
Official Page: Go to website
Last Update: January 1, 2014
License: MIT

Preview:

Creating A Simple Digital Countdown Timer with timerJS

Description:

timerJS is an easy and minimal javascript timer used to count down in seconds, minutes, hours and days to a given time.

Basic Usage:

Include timerJS script in your document.

<script type="text/javascript" src="./timerJS.js"></script>

Create a container with data-timer attribute that specifies a time you want to count down.

<span class="demo" data-timer="600000"></span>

The javascript.

<script type="text/javascript">
var timers = new TimerJS('.demo',{
on_end:function(el){
console.log(el)
}
});
</script>

Available options.

end_text: "end",
time_null: ".:..:..:..",
alert_end1: 120000,
alert_end2: 60000,
alert_end3: 20000,
alert_color: "#ff2600",
alert_background: "#660000",
prog_color: "#76d6ff",
prog_background: "#011993",
blink: false,
pre_text: ""

You Might Be Interested In:


Leave a Reply