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

144
Views
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 answers
Answer question

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 Report
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!