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

152
Visualizações
Changing the title of the page to dynamic title when window onblur

I want to change the title of the page when visitor at another tab. I checked the forum but I need something like this;

    (function titleScroller(text) {
    document.title = text;
    console.log(text);
    setTimeout(function () {
        titleScroller(text.substr(1) + text.substr(0, 1));
    }, 200);
}("Come back please ❤" + " " +"Miss you ❤" + " " + "Hello? ❤" + " " ));

or can I add scrolling title to this code?

jQuery(document).ready(function($) {
    // any code js
    var title = document.title;
  var alttitle = "Miss You ❤";
  window.onblur = function () { document.title = alttitle; };
  window.onfocus = function () { document.title = title; };
    
  });
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can listen for visibilitychange event in your code and trigger whatever function you like.

document.addEventListener("visibilitychange", event => {
  if (document.visibilityState == "visible") {
    console.log("tab is active")
  } else {
    console.log("tab is inactive")
  }
})
about 4 years ago · Juan Pablo Isaza Relatório
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