Skip to content

Stop function needs callback #1

@qlereboursBS

Description

@qlereboursBS

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @qlereboursBS

        Issue actions

          Stop function needs callback · Issue #1 · unthunk/jquery-countdown-timer