TIMER INTERVAL PROBLEM:
I'm trying to make a timer, but when I click off of the Timer tab the Timer's countdown stops (interval stops?). I tried using some jquery for the $(window).focus to continue counting down. I was unable to figure that out...
var timerInterval;
$(window).focus(function() {
if (!timerInterval)
timerInterval = setInterval(startTimer, 10);
});
$(window).blur(function() {
if (!timerInterval)
timerInterval = setInterval(startTimer, 10);
});
Here is the code for my Timer: https://codepen.io/0cean-Man/pen/NWyRPRX
DISCLAIMER: The Jquery is not working on codepen, I don't know how to make the js Jquery compadible on codepen.