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

131
Views
Cerrar galería cuando haga clic fuera del elemento- JavaScript/Angular

 openModalAttachment(template: TemplateRef<any>, index: number) { this.index = index; this.getFile(index); this.modalRef = this.modalService.show(template); this.openModalAnexo = true; this.fullScreen(); } onClick(event) { event.stopPropagation(); var modalAnexo = document.getElementById('imgAnexo'); console.log(this.openModalAnexo, modalAnexo); if (this.openModalAnexo && !modalAnexo) { console.log(event.target); this.openModalAnexo = false; modalAnexo = null; this.closeFullScreen(); } } onCloseAttachment() { this.message = 'Declined!'; this.index = -1; this.modalRef?.hide(); this.closeFullScreen(); } closeFullScreen() { document.onclick = function (event) { if (document.fullscreenElement) { event.stopPropagation(); document .exitFullscreen() .then(() => console.log('Document Exited from Full screen mode')) .catch((err) => console.error(err)); } }; } fullScreen() { if (!document.fullscreenElement) { document.documentElement.requestFullscreen(); } }
 <img src="/assets/icons/eysblue.svg" class="openAtchament" (click)="openModalAttachment(attachment, j)" *ngIf="collapseData.label == 'ANEXOS'"> <ng-template #attachment > <div class="" id="myModal"> <div class="modal-content"> <div class="modalOpenGaley"> <span class="close" (click)="onCloseAttachment().document.getElementById('lightbox')">&times;</span> <embed [src]="file" #files id="imgAnexo" class="files-images-pdf" type="application/pdf"> <img [src]="file" id="imgAnexo" class="files-images-pdf" /> <div id="caption"></div> </div> </div> </div> </ng-template>

He investigado mucho y no he encontrado nada, soy bastante lego, por favor ayúdame. al abrir mi imagen, debe abrirse en pantalla completa, cuando hago clic fuera de la imagen para cerrarla, hay un error de no salir en modo de pantalla completa.

hacer clic es pantalla completa como esta: ingrese la descripción de la imagen aquí

la correcta sería: al hacer clic fuera de la imagen, cerrar la pantalla completa y quedar así:

ingrese la descripción de la imagen aquí

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!