Popup form window

  • 12 October 2011
  • 37 replies
  • 56 views


Show first post

37 replies

Would it be possible to have the pop up light box without having a button trigger?

Ahaaa… Since I have the “enable Fancybox” ticked, I simply removed the…

Thanks for the quick reply. I’ve tried the code, but I can’t get it to work. There is no fancybox action happening at all, just the new page opening up, replacing the old one. I suppose I need to take a crash course in JQuery?

Hey Thomas - that’s right. We made some changes to our editor a couple months back and moved the Javascript tool from the menu up top down to the footer. I’ve updated the article to reflect that change. Thanks for the heads up.

When inserting the code, it should be done “in the lower left” right? In the “JAvascrips” and “Stylesheets” areas?

I’m joining in late here…
Thanks Ryan it is very useful.

Is there any way to set that a popup will open up (after a button is clicked) in a form of “new window” rather than a lightbox?

I’d then like to be able to define the exact size of the new window pop up.

Can you help with that?

Thanks,
Gil

For noobs important thing to make it work is that ‘JQuery’ box should be marked in JavaScript dialog.
Without JQuery included on the page fancybox popup will not wok.

Ryan - thanks. This definitely fixed the my desktop browser issue, but it didn’t resolve the z-index issue on any of the Android-based mobile browsers I tested. Any suggestions?

Hi John - sure thing

You’ll essentially just swap out the ‘new’ YouTube embed code for the ‘old’ code and add a snippet the the script. This knowledge base article should point you in the right direction: http://support.unbounce.com/entries/2…

Glad to hear that this article helped you set up your light box form!

This is great. Thank you for the detailed information. I was able to implement this in just a few minutes.

One question/issue: I’m using this on a page that includes a YouTube video embedded in the page. There are some quirky visual issues that I assume are related to the z-index. If the lightbox opens so that the upper-right corner hovers over the embedded video, the “X” used to close the lightbox div is partially obscured. Also - when the page is opened in various mobile browsers, the embedded video appears above the lightbox which makes it impossible to fill in the form fields inside the lightbox div.

Is there any way to adjust the code so that these issues don’t occur?

One more note: I should mention that the scripts I provided here will work on a page that does not contain a form.

If your page contains a form, you will need to slightly modify the scripts you use. Until the full knowledge base article is posted, send us at email to support@unbounce.com and we’ll send the modified instructions your way.

Hello Ahmad - this is definitely something you can do

You’ll have to create two separate landing pages and use some javascript, but these directions should help you move forward:

Step A - Design and publish the page you want to appear in the Lightbox

This page should be constrained to an appropriate size for your lightbox (ie: be relatively small). Make note of its height, width, and published URL as you will need this information in the next step.

Step B - Add the javascript to trigger a lightbox on your main Page

Open your main page (the one with the action button) in the editor and follow these steps:

  1. Assuming you want a button to trigger the lightbox, paste the following script into the HEAD of your page using the Javascript tool:
<script src="http://assets.unbounce.com/m/lp-webapp/0.0.9/fancybox/jquery.fancybox-1.3.1.js" type="text/javascript" charset="utf-8"></script>   
 
<script type="text/javascript"> <br /> jQuery(function() { <br />
 if (jQuery("a.lp-pom-button[target='_self']").fancybox.length) { <br />
   jQuery("a.lp-pom-button[target='_self']").fancybox({ <br />
     'width'
        : 400, <br />
     'height'
       : 600, <br />
     'autoScale'
    : 'true', <br />
     'transitionIn'
 : 'elastic', <br />
     'transitionOut'
: 'fade', <br />
     'type'
         : 'iframe' <br />
   }); <br />
 } <br />
}); <br /> </script>   

Edit the ‘width’ and ‘height’ values to match the size of your page from Step A

  1. Then, paste the following script into the ‘CSS Custom’ dialog box:
<link rel="stylesheet" href="http://assets.unbounce.com/m/lp-webapp/0.0.9/fancybox/jquery.fancybox-1.3.1.css" type="text/css">   
  1. In the main editor window, select the button you want to trigger the lightbox. Type the URL of your form (from Step A) into the link field, for target choose ‘Same Window (_self)’

  1. Set your conversion goal to be the link to your form page:

These steps will cause a button whose target is ‘Same Window (_self)’ to open the link in a lightbox.

You can separately track the number of users who clicked the button vs. the number of users who submitted the form by comparing the stats between your two pages:

  • Your form page’s stats (from Step A) will reflect the number of users who submitted the form. Your lead data will also be found/managed with this page.

  • Your main page’s stats (Step B) will reflect the number of users who clicked the button.

I hope this helps you achieve what you were looking to do!

Reply