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

Countdown timer does'nt start again from 0 #93

Closed
subhajeet2107 opened this issue Aug 5, 2019 · 2 comments
Closed

Countdown timer does'nt start again from 0 #93

subhajeet2107 opened this issue Aug 5, 2019 · 2 comments

Comments

@subhajeet2107
Copy link

We want to continue the timer after it reacher 0, in the 0.7.0 version it was working fine but right now it is not working also i can see this functionality was added recently but there is no documentation.
how to continue countdown timer after it reaches 0 ?

@walmik
Copy link
Owner

walmik commented Aug 8, 2019

Hi @subhajeet2107 It would defeat the purpose of a countdown if the timer started again automatically. I m assuming you want to start counting "up" after a countdown is completed. However you can do it by just removing the current timer on the element and then starting it in the callback property that the timer allows.

$('#t').timer({
  duration: '10s',
  countdown: true,
  callback: function() {
    $("#t").timer('remove');
    $('#t').timer();
  }
});

Click here for a JS Bin that demonstrates this

@subhajeet2107
Copy link
Author

Thanks, earlier a recent pull request added this functionality by default, but it was not working in the latest version.
This will work for now, but if we could add a flag that added the asked functionality it would be great, for example set a flag countUpAfterDone:true, this will allow countdown to counting up from 0 after countdown finishes.
callback also works

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