Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

79
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda