hilios / jQuery.countdown

The Final Countdown plugin for jQuery
http://hilios.github.io/jQuery.countdown/
MIT License
2.3k stars 720 forks source link

Timer pause/resume or stop/start as well as remove are not working properly #344

Open PhiratPlayz opened 3 months ago

PhiratPlayz commented 3 months ago

Hey there,

I was trying to customize a timer to make it work as a subathon timer (setting the timer up when somebody subs or donates).

I got a premade script to customize by streamelements in which they use this library...

the first problem is: If I pause the timer via a pressed button and resume it, it does not resume the countdown where it stopped but with the timestamp of when the resume button is pressed due to how this countdown works. It always gets the current timestamp and calculates the difference until the end date. So the timer just jumps to the new result of this calculation.

grafik

2nd Problem that occured: the main purpose of the customization was to make the countdown work half as fast during nights/ when a button is pressed. If the above thing is fixed one of my attempts to solve this should work (pause the timer for 1 sec and resume it afterwards again). Due to the above mentioned problem it just shows every 2 seconds a 2 second skip. Since this does not work due to already addressed problems I tried another way on solving this.

The other way was to add every 2 seconds 1 sec to the countdown. But the $('#divID').countdown('remove') does not kill the other instances. It just removes the attachments to the html dom element. so by time more and more countdown instances run in the background. and thus the ram is running full until its too much and the timer just stops working because it cant calculate all of the instances anymore. So an method to actually killing the instances would be nice to have.

I tried so much different stuff and even had a deep look inside your code but I found nothing that helps me in this case.

Appreciate any help... Thanks in advance