Auto open the lightbox form after 15 seconds

  • Profile Image
    trainings24x7
    Asked on November 30, 2015 at 08:17 AM

    2. I want to make my form auto and open after 15 seconds.

     

    3. I also want to close this form, once it auto appears (for those)

     

    See the following code regarding this i have used in the website (header.php) wordpress

     

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

        if(window.innerWidth <= 499) {parentWidth = window.innerWidth;} else {parentWidth =  500;}
    var JFL_53300890979464 = new JotformFeedback({ formId: '53300890979464', base:

    'https://form.jotform.me/', windowTitle: 'HELP? Contact Us', background: '#FFA500', fontColor:

    '#FFFFFF', type: 'false', height: 500, width: parentWidth, openOnLoad: true }); </script>

    <a id="lightboxdelay" class="btn lightbox-53300890979464" style="margin-top: 16px display:none;">

    Help? Contact Us </a>

    <script language="JavaScript">
    var delayseconds = 15;
        function pause() {
        myTimer = setTimeout('whatToDo()', delayseconds * 1000)
        }
       function whatToDo() {
    document.getElementById('lightboxdelay').click();
        }
    window.onload = pause;
    </script>

     

    Still form opens as website opens, delayseconds is not working

  • Profile Image
    Welvin
    Answered on November 30, 2015 at 08:58 AM

    Please use the following lightbox scripts instead: http://pastiebin.com/565c55b300064

    This is working to my end. Here's an example page: https://shots.jotform.com/welvin/html/lightbox-delay.html.

    Please let us know if you need any further assistance implementing this.

  • Profile Image
    trainings24x7
    Answered on December 02, 2015 at 01:19 AM

    Please let me know that - I have wordpress website and where i can use this code. In header.php or somewhere else??

  • Profile Image
    trainings24x7
    Answered on December 02, 2015 at 01:33 AM

    Thanks Welvin,

     

    Now code is working in my wordpress.

  • Profile Image
    Jan
    Answered on December 02, 2015 at 05:10 AM

    Glad to hear that your issue is now resolved. On behalf of Welvin, you're welcome. Let us know if you need further help. Thank you.

  • Profile Image
    nishant
    Answered on December 04, 2015 at 11:32 PM

    Thanks Jan,

    But can i ask here one more question -

    What if i want my lightbox form on visibile for desktop. not for mobile, tablet and etc. Is there any wany to do it??

     

    Thanks,

    Nishant

  • Profile Image
    Welvin
    Answered on December 05, 2015 at 03:47 AM

    The lightbox should be visible in the desktop. But I think you mean how to adjust the width of the lightbox form when viewed using a desktop. Is this correct? I will try to check this further and then let you know.

  • Profile Image
    trainings24x7
    Answered on December 05, 2015 at 04:04 AM

    Yes.

  • Profile Image
    Welvin
    Answered on December 05, 2015 at 05:23 AM

    Thank you for the confirmation. I will let you know here once I have the correct codes for auto width adjustments.