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

  • armadill
    Asked on July 7, 2015 at 2: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
  • Kiran Support Team Lead
    Replied on July 7, 2015 at 2: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 href="javascriptDISABLED:void(0)" onDISABLEDclick="OpenPopupCenter('http://form.jotformpro.com/form/23167354874663', 'Suscripción al Newsletter', 700, 500);">Suscripción al Newsletter</a>

     

    Hope this information helps!

  • fotobaren_
    Replied on July 21, 2016 at 12:04 PM