Center a Popup Form

  • EffieMcNair
    Asked on February 11, 2018 at 9:54 PM

    Hi There,

    I am wondering how to make the Popup form opening in the middle of the screen rather than in the upper left corner? (website link attached - roll down to see 'Instant Quote' buttons)

    Thanks,

    Effie

  • BJoanna
    Replied on February 12, 2018 at 5:33 AM

    Inside of this article, you can find how to center the popup form:

    https://stackoverflow.com/questions/4068373/center-a-popup-window-on-screen 

    You will have to add the following script to your webpage:

    <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>

    and modify the popup code of your form to this:

    <a target="_blank" href="javascriptDISABLED:void(0)" onDISABLEDclick="OpenPopupCenter('https://www.jotform.com/80368192005857', 'INSTANT QUOTE', 700, 500);">INSTANT QUOTE</a>

    You can also use a LightBox form:

    How to Create a Lightbox Form

    Hope this meet what you are looking for. 

  • EffieMcNair
    Replied on March 24, 2018 at 8:18 AM
  • John_Benson
    Replied on March 24, 2018 at 10:38 AM

    Hi EffieMcNair,

    We receive a blank reply from you. Is the issue resolved? If yes, please disregard this message.

    If not, please reply again and make sure you're logged in to your account. 

    Thank you.