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

277
Views
Ocultar botón al hacer clic para mostrar el texto del aviso, luego, después de 5 segundos, ocultar el texto nuevamente y volver a mostrar el botón

Quiero mostrar la (i) imagen como un botón y cuando alguien haga clic en él, quiero ocultar el botón y mostrar el Aviso: ¡gracias por su paciencia! texto, y después de 5 segundos quiero volver a mostrar el botón y ocultar el texto como estaba.

 <button id="info" onClick="hideText()"><img src="//i.imgur.com/45PUhN3.png"/></button> <div class="info-hide">Notice: thanks for your patience!</div>

Probé con este código, pero no funcionó:

 <script type="text/javascript"> setTimeout(function hideText() { $("#hide").fadeOut(".info-hide"); }, 5000); </script>

¡Gracias!

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

 function hideText() { $("#hide").fadeIn() setTimeout(() => { $("#hide").fadeOut() }, 5000); }
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <button id="info" onClick="hideText()"><img src="//i.imgur.com/45PUhN3.png"/></button> <div class="info-hide" id="hide" style="display: none;">Notice: thanks for your patience!</div>

about 4 years ago · Juan Pablo Isaza Report

0

Prueba lo siguiente:

 <button id="info" onClick="hideText()"><img src="//i.imgur.com/45PUhN3.png"/></button> <div class="info-hide" style="display:none">Notice: thanks for your patience!</div> <script> function hideText() { // hides text for 5 secs const btn = document.querySelector('#info'); const infoHide = document.querySelector('.info-hide'); infoHide.style.display = "block" btn.style.display = 'none' setTimeout(()=>{btn.style.display = 'block'; infoHide.style.display= "none"}, 5000) } </script>

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!