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

133
Views
agregando setTimeout para cerrar un precargador

No soy tan bueno en javascript y estoy tratando de agregar setTimeout para cerrar mi precargador después de cierto tiempo, pero no funciona. ¿Alguien me puede ayudar? Muchas gracias.

 document.onreadystatechange = function () { var e = document.readyState; "interactive" == e ? ((document.body.style.overflow = "hidden"), (document.getElementById("contents").style.visibility = "hidden")) : "complete" == e && setTimeout(function () { document.getElementById("interactive"), (document.body.style.overflow = "auto"), (document.getElementById("load").style.visibility = "hidden"), (document.getElementById("contents").style.visibility = "visible"); }, 1e3); setTimeout(e, 3500); };
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Si entendí correctamente lo que estás tratando de lograr, esto es lo que estás buscando.

 window.addEventListener('load', () => { // wait to load the page setTimeout(() => { document.querySelector('.loader').style.display = 'none' // hide the loader after 3.5 seconds console.log('loaded') }, 3500) })
 <div class="loader">Loading...</div>

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!