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

190
Views
Parpadea y cambia el título del sitio web cuando el usuario no está en la pestaña

Quiero atraer la atención del usuario al sitio web cuando esté en una pestaña diferente, por lo que me gustaría recrear el efecto de sephora.pl

Si sale, verá una alerta agradable como título ("¿Qué está esperando?"), y luego volverá al título de la página. El efecto se detiene cuando vuelves a estar en la página. Me las arreglé para crear estas partes y me quedé. ¿Alguna idea de cómo hacer que parpadee?

 $(function() { // Get page title var pageTitle = $("head title").text(); // Change page title on blur $(window).blur(function() { $("title").text("Come back to us"); // Somehow make it blink between Come back to us and pageTitle every 1200ms or so... }); // Change page title back on focus $(window).focus(function() { $("title").text(pageTitle); }); });
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Podrías usar javascript simple. Algo como esto;

 let defaultTitle = document.title window.onblur = () => { //change title, blink title, whatever document.title = "New title" } window.onfocus = () => { //back to default title document.title = defaultTitle }

Por cierto, sí, lo he visto en Alibaba, así que supongo que aumenta los clientes potenciales.

about 4 years ago · Juan Pablo Isaza Report

0

Bien, después de unas pequeñas charlas en la sección de comentarios logré que funcionara así:

 const orginalTitle = $(document).prop('title'); function flashText() { const newTitle = ('Back to us!'); if ($(document).prop('title') === orginalTitle) { document.title = newTitle; } else { document.title = orginalTitle; } } $(function changeTitle() { let nIntervId; $(window).blur(function() { if (!nIntervId) { nIntervId = setInterval(flashText, 1100); } }); $(window).focus(function() { clearInterval(nIntervId); nIntervId = null; $("title").text(orginalTitle); }); });
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!