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

290
Views
Align center the Popup child window based on parent window inner height

How to set Popup child window center of parent window for different browsers

Please check here

Please check the below code. Tried below code for child popup center.

code var new_window;
function winOpen(){
width = window.innerWidth - 100; height = window.innerHeight - 120; var top = (screen.height - window.innerHeight) - 10; var left = 100 / 3;
new_window=window.open('https://www.google.com',"_blank","toolbar=0, help:no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no,width=" + width + ", height=" + height + ",top=" + top + ",left=" + left + "");
}
code

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

0

You can center elements inside the DOM in numerous ways, they are too many to list. However, usually it is done without JavaScript (your tag), but rather with CSS.

One way is by setting display:flex;, place-items:center and justify-content:center; on the parent;

Here is an example:

.parent {
  width: 150px;
  height: 150px;
  background: #08f;
  
  display: flex;
  justify-content: center;
  place-items: center;
}

.child {
  width: 95px;
  height: 95px;
  background: #0a0;
}
<div class="parent">
  <div class="child">Child</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!