How do I center the popup form window on the screen?

  • Profile Image
    Asked on July 07, 2015 at 02:40 PM
    Is there a code I can add to that so that it always opens in the middle of the screen, like the lightbox?
    Thank you.
  • Profile Image
    Answered on July 07, 2015 at 02:41 PM

    You may try using the following modified code from the source here to embed on your webpage that opens the pop-up in the center of the page.

    <script language="javascript" type="text/javascript">

            function OpenPopupCenter(pageURL, title, w, h) {

                var left = (screen.width - w) / 2;

                var top = (screen.height - h) / 4;

                var targetWin =, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);



        <a target="_blank" href="javascript:void(0)" onclick="OpenPopupCenter('', 'Suscripción al Newsletter', 700, 500);">Suscripción al Newsletter</a>


    Hope this information helps!

  • Profile Image
    Answered on July 21, 2016 at 12:04 PM