Skip to content

Stop function needs callback #1

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

Open
qlereboursBS opened this issue Jul 22, 2017 · 0 comments
Open

Stop function needs callback #1

qlereboursBS opened this issue Jul 22, 2017 · 0 comments

Comments

@qlereboursBS
Copy link

Hi,

I had an issue with the method stop. Immediately after stoping the countdown, i was reinitializing a new one on the same div. The problem was that it kept the old data.
For example:
1 - Countdown is at 1'47"
2 - I call stop
3 - I call an init with m = 2, s = 0
4 - The countdown displays 2'00" and immediatly it returns to 1"47 and keeps decreasing with the old parameters.

I solved this by adding a timeout before reinitializing the countdown:

countdown.countdown('stop');
window.setTimeout(function () {
      countdown.countdown({
            autostart: true,
            m: 2,
            s: 0
        });
});

Thanks for this plugin

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

1 participant