Skip to content

Instantly share code, notes, and snippets.

@victorzen
victorzen / Image_placholder.md
Last active Oct 23, 2017
Image place holder for embedded video
View Image_placholder.md
  1. Add a video using the video widget.
  2. Add an image on top of the video, making sure it covers it. You can use the Geometry tools to make sure it matches size and position.
  3. Add a 'play button' image.
  4. Paste the script choosing Before Body End tag as the placement.
  5. Replace #lp-pom-video-17, #lp-pom-image-18 and #lp-pom-image-19 for the IDs of your video, image and button image respectively.
  6. Save, republish and enjoy!

Notes: -The click on the image and button will be counted as a conversion. -You can change the image fadeout speed by changing the value in line $(".dis").fadeOut(2000); The value is in milliseconds.

@victorzen
victorzen / exclude_pages_from_Script_Manager.md
Last active Aug 14, 2017
Exclude pages from Script Manager
View exclude_pages_from_Script_Manager.md
<script> 
$( document ).ready(function() {  
  
	//Change this ID's for the ID's of the pages you'd like to exclude.
	var exclude = ["d295a5b5-9761-4e54-a776-76fcbcafdd7e", 
                       "582eee08-77a6-4038-8e92-8c356f1bb64b", 
                       "dcd9aed3-ca05-4f9c-9fb9-4f09b44246e7"]; 
   
  	//Get page id.
@victorzen
victorzen / Convertable between two dates.md
Last active Aug 14, 2017
Trigger a convertable between two given dates
View Convertable between two dates.md
<script>
  
    //Add your Convertable code. Don't forget to add \ before the closing > as in the exmple below.
    var convStr = '<script src="//a0a1179f80df414f91512d8919c3e847.js.ubembed.com" async></script\>';	
  
    //Add the start and end dates using the format mm/dd/yyyy. 
    var startDate = '05/05/2017';
    var endDate = '05/09/2017';
  
@victorzen
victorzen / auto-capitalize_form_fields.md
Last active Feb 21, 2017
Auto-capitalize Form Fields
View auto-capitalize_form_fields.md
<script type="text/javascript">

/*
Unbounce Community :: Tips & Scripts :: Auto-capitalize Form Fields
TS:0002-08-064
***********************
Do not remove this section. It helps our team troubleshoot possible issues and track feature usage and adoption.
*/
@victorzen
victorzen / Dropdown menu text color change.md
Last active May 8, 2017
Text color in dropdown menu matches text color in placeholders and turns black when selection is made.
View Dropdown menu text color change.md

Javascript:

<script>
   lp.jQuery(document).ready(function($) {  
      $("select").addClass("notselected");       
      $("select").live('change', function() {
         $("select").removeClass("notselected")
      });
   });
</script>
@victorzen
victorzen / Flexible Form Fields.md
Last active Apr 22, 2021
Allows you to place form fields anywhere on the page
View Flexible Form Fields.md
<script>
/**
    * Do not remove this section; it allows our team to troubleshoot and track feature adoption. 
    * TS:0002-08-042
*/
  lp.jQuery(document).ready(function($) {
    
    //Change #lp-pom-box-01, etc. for the IDs of the boxes where you want the form fields to display.
    var boxes = ["#lp-pom-box-01",
@victorzen
victorzen / Element appears on timer.md
Last active Jun 17, 2016
Make element appear on timer.
View Element appears on timer.md

Change '#lp-pom-block-10' for the ID of the element you want to hide and make re-appear in both the javascript and the CSS. You can add multiple elements separating them by a comma ('#lp-pom-block-10, #lp-pom-button-75'). Change 5000 to adjust the timer, time is in milliseconds.

Javascript:

<script>
window.setTimeout(function () {
  $('#lp-pom-block-10').show();
  }, 5000);
</script>
@victorzen
victorzen / Error message disappears.md
Last active Oct 17, 2016
Error message disappears when clicked or after a few seconds
View Error message disappears.md

Paste the following code in the Javascripts section of your page selecting 'Before Body End Tag' as the placement:

<script>
  $(function(){
    $(".lp-form-errors").click(function(){
      $(".lp-form-errors").fadeOut()
    }); 
    $('.lp-pom-form .lp-pom-button').click(function(){
    
@victorzen
victorzen / Phone field format.md
Last active Mar 31, 2017
Give phone numbers any format in the form field
View Phone field format.md

Paste the following script in the Javascripts section of the page selecting 'Before Body End Tag' as the placement. You can change the mask to any phone number format you want:

<script src="https://code.jquery.com/jquery-1.12.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/3.1.62/jquery.inputmask.bundle.js"></script>

<script>
/**
    * Do not remove this section; it allows our team to troubleshoot and track feature adoption. 
    * TS:0002-08-073
@victorzen
victorzen / Max number of characters in a field.md
Last active Apr 16, 2016
Limit the number of characters allowed in a form field.
View Max number of characters in a field.md

Some services that integrate with Unbounce impose a maximum number of characters, including spaces, that you can add into a field.

For example MailChimp, Campaign Monitor, Constant Contact and Zoho CRM allow a maximum number of around 250 characters, while other services like AWeber have a limit of between 16 to 33, depending on the type of characters.

In order to avoid integration errors, you can limit the amount of characters allowed in your form fields by adding the following script to the Javascripts section of your page, selecting "Before Body End Tag" as the placement:

<script> 
$(document).ready(function(){

//Change 'email' for the ID of your form field and '10' for the max number of characters allowed.