A jQuery plugin for simple countdown timer.
To use this library, you need to include jQuery library.
let options = {
seconds: 5,
loop: true,
callback: function () {
// do something
}
};
$('#selector').countdownTimer({options});- Set the number of seconds, the default is 5 seconds.
- Set whether to loop the timer or not.
- If loop is true, when the timer hits 0, it loops back to the original (5) seconds.
- Set the callback function, the default is
null.- If the callback function is not null, it is called when the timer hits 0.