Break countdown timer when you re-visit the site how to do so when re-entering the timer was counting down again?

0 like 0 dislike
10 views
Good day, in flipclock countdown timer with cookies, that is the time when rebooting or closing the tab is not reset and keeps going and when the timer expires it is restarted.

The crux of the matter:
for example if the end of the timer will be 10 seconds and this time to close the tab with the site and wait 10 seconds (so the timer has completed the countdown and started again) and again go to the website, the timer gives an error and stops working. Tried this way and that, still not working, and I realized that could use the assistance to understand what is wrong in the code.

Here is a link to jsfiddle
Here is the same code only poured it on the host
by | 10 views

2 Answers

0 like 0 dislike
Timer continues to count down when closing a tab
\rhttps://jsfiddle.net/vwzjkbtg/5/
by
0 like 0 dislike
init: function () { if ( Date.now() > $.cookie("endDate") ) { $.removeCookie("endDate"); } if (!$.cookie("endDate")) { var t = Date.now() + 10000; $.cookie("endDate", Math.round(t / 1e3)) } },
by
110,608 questions
257,186 answers
0 comments
28,664 users