Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

78
Views
How to make a Timer continue counting down when not in the same tab?

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!