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

127
Views
No se puede eliminar la vista previa de la imagen después de hacer clic fuera de div o cerrar el botón javascript PHP

Estoy trabajando en Php con jquery, tengo jquery Popup modal y en este momento estoy mostrando una vista previa de la imagen, quiero que cada vez que haga clic fuera del modal o haga clic en el botón cerrar (close_btn_t), la imagen debería eliminarse y hacer clic en el botón Examinar, la imagen seleccionada debería mostrarse , Cómo puedo hacer esto ? Aquí está mi código

 <div class="modal-content"> <div class="preivew-right-bar"> <span class="previewpostimage"><img id="thumb" src="blob:https://xxxxxxxxx/0d865270-6aee-4873-8c4a-16a67273e3e6" style="display: none;"></span> <span class="close_btn_t"> <button type="button" id="closebtn"><span aria-hidden="true">×</span> </span> </div> </div>

Intenté con el siguiente código

 $('body').click(function (event) { if ( event.target.matches(".button-close-modal") || !event.target.closest(".modal-content") ) { $(".previewpostimage").html(""); $('.previewpostimage').val(''); } });
about 4 years ago · Juan Pablo Isaza
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!