Countdown.JS by Technetium PHP Framework

Dependencies

Countdown.JS does not rely on any third-party libraries.

Usage

var myCounter = new Countdown(time, function(t) {
    // do something when still counting
    console.log(t + ' seconds to go...');
}, function() {
    // do something when counter reached 0
    console.log('Now it ends.');
});

Methods

Name Description Return
getRemainingTime() Return the remaining time (in seconds) of the counter. int
reset(time) Set the counter to a given time (in seconds) and continue the countdown. void
restart() Restart the counter to the initial time. void
terminate() Stop the countdown. void