Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda