jquery-countdown-timer icon indicating copy to clipboard operation
jquery-countdown-timer copied to clipboard

Stop function needs callback

Open qlereboursBS opened this issue 8 years ago • 0 comments

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

qlereboursBS avatar Jul 22 '17 16:07 qlereboursBS