hilios / jQuery.countdown

The Final Countdown plugin for jQuery
http://hilios.github.io/jQuery.countdown/
MIT License
2.3k stars 720 forks source link

How to reset the counter when it reaches zero? #331

Open pabloo83 opened 3 years ago

pabloo83 commented 3 years ago

I want the counter to reset automatically and I don't always have to do it manually. Excuse the english

aroon9002ahmed commented 3 years ago

this maybe help

var fiveSeconds = new Date().getTime() + 5000;
$('#clock').countdown(fiveSeconds, {elapse: true})
.on('update.countdown', function(event) {
  var $this = $(this);
  if (event.elapsed) {
    $this.html(event.strftime('After end: <span>%H:%M:%S</span>'));
  } else {
    $this.html(event.strftime('To end: <span>%H:%M:%S</span>'));
  }
});