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

  • Profile Image
    armadill
    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.
    Regards.
    Eduardo
  • Profile Image
    Kiran
    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 = window.open(pageURL, 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);

            } 

        </script>

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

     

    Hope this information helps!

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