Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pabloo83 opened this issue Dec 15, 2020 · 1 comment
Open

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

pabloo83 opened this issue Dec 15, 2020 · 1 comment

Comments

@pabloo83
Copy link

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

<script> $('[data-countdown]').each(function() { var $this = $(this), finalDate = $(this).data('countdown'); $this.countdown(finalDate, function(event) { $this.html(event.strftime('
%D
Días
%H
Horas
%M
Min
%S
Seg
')); }); }); </script>
@aroon9002ahmed
Copy link

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>'));
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants