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
HTML CSS: div de zoom en el centro de la celda de la tabla como una ventana emergente

Estoy usando Angular. En la celda de la tabla, estoy usando div, pero necesito mostrar el div como una ventana emergente en un evento de clic. Hice clic en la lógica de eventos, pero cómo mostrar el elemento div como una ventana emergente que se coloca entre una celda de la tabla sin usar ninguna biblioteca como bootsrap o material angular

 <table> <tr> <th>Name </tr> <th>Age </th> <th>Details </th> <th> Blood Group</th> <th> Phone </th> </tr> <tr *ngFor= " let details of DetailsList; index as i" > <td> {{i + 1}} <td> <td> {{details.name }} <td> <td> {{details.age}} <td> <td> <button (click)="divbox(details)" > </button> <div *ngIf="details.box" class="boxelement"> <button (click)="close(details)" > close</button> Address No: {{details.address.no}} Area: {{details.address.area}} Pincode: {{details.address.pincode}} </div> <td> <td> {{details.bloodgroup}} <td> <td> {{details.phone}} <td> </tr> </table

ts parte

 divbox(data){ data.box = true } close(data){ data.box = false }

parte css

 .boxelement{ background: white; border-radius: 2px; display: inline-box; height: 700px; margin: 1rem; position: relative; width: 70%; box-shadow: 0 19px 38px rgba(0,0,0,0.30) }

Necesito este div como una ventana emergente en el centro de la página, ¿es posible?

imagen de muestra de internet

https://wisepops.com/wp-content/uploads/2017/12/Nike-popup-1.png

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

0

Una ventana emergente simple que se centra usando flex .

Puede activarlo haciendo clic en el botón definido para mostrarlo y cerrarlo usando display: none .

 function func(){ document.getElementById('container').style.display = "flex"; } function funcClose(){ document.getElementById('container').style.display = "none"; }
 #container { position: fixed; top: 0; left: 0; height: 100vh; width: 100vw; display: none; background-color: rgba(126, 125, 125, 0.5); } #popUP { display: flex; justify-content: center; align-items: center; height: 200px; width: 200px; background-color: rgb(255, 197, 197); margin: auto; position: relative; } #popUP button { position: absolute; right:0; top:0; }
 <button onclick="func()">Pop me UP</button> <div id="container"> <div id="popUP">My first Pop UP <button onclick="funcClose()">X</button> </div> </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!