My lightbox newsletter form is not responsive

  • Profile Image
    discoverdelicious
    Asked on July 20, 2016 at 01:45 PM

    Whatever I change, my lightbox newsletter form will not adjust to the correct width on mobile. Can you help?



    This is a re-post of a comment on Deprecated: How to make mobile friendly forms on JotForm

  • Profile Image
    Kiran
    Answered on July 20, 2016 at 02:23 PM

    Unfortunately, the lightbox form is not responsive at the moment. Please try embedding your JotForm using the following code and see if that helps.

    <script src="https://form.jotform.me/static/feedback2.js?3.3.REV" type="text/javascript"> 

      // get current width of the window

        var parentWidth = window.innerWidth;

        var parentHeight;

        // check if the window size is less than 499, assuming that it means it is viewed on a mobile device

        if(window.innerWidth <= 499) {

        parentWidth = window.innerWidth; // if it's in mobile view assign the current width to this variable

            parentHeight = window.innerHeight - (window.innerHeight * 0.1);

        } else {

        parentWidth =  700; // if it's viewed on a window larger thatn 499px then set the width to 500px

            parentHeight = 500;

        }

    var JFL_62002097936354 = new JotformFeedback({ 

    formId: '62002097936354', 

    base: 'https://form.jotform.me/', 

    windowTitle: '', 

    background: 'transperent', 

    fontColor: '#FFFFFF', 

    type: 'false', 

        height: parentHeight,

        width: parentWidth,

    openOnLoad: true 

    }); 

    </script>

    Let us know if you need any further assistance. We will be happy to assist. 

     

  • Profile Image
    discoverdelicious
    Answered on July 21, 2016 at 05:14 AM

    Hi there.

     

    Thank you so much, this seems to work great! Do you reckon you could help me out with the problem that seems to follow on from this one?

    The Lightbox opens every time a new page is loaded from the website. I've had a look for this problem and it seems to be a common one. However the PHP solution generally offered is a little beyond me. Could you help me out?

    Also, can you see (or not see) the X in the corner of the lightbox pop up to close it? How do I change this colour so it is visible without messing up your lovely script you sent me?

    Thanks again.

  • Profile Image
    beril
    Answered on July 21, 2016 at 07:49 AM

    I've created a separate thread for you, so anyone in the support staff will be able to assist you with your specific requirement. Please follow up there:

    https://www.jotform.com/answers/887634

    https://www.jotform.com/answers/887635