Skip to content

Instantly share code, notes, and snippets.

@victorzen
victorzen / Image_placholder.md
Last active October 23, 2017 15:32
Image place holder for embedded video
  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 August 14, 2017 02:22
Exclude pages from Script Manager
<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 August 14, 2017 02:21
Trigger a convertable between two given dates
<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 February 21, 2017 20:58
Auto-capitalize Form Fields
<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 18:08
Text color in dropdown menu matches text color in placeholders and turns black when selection is made.

Javascript:

<script>
   lp.jQuery(document).ready(function($) {  
      $("select").addClass("notselected");       
      $("select").live('change', function() {
         $("select").removeClass("notselected")
      });
   });
@victorzen
victorzen / Flexible Form Fields.md
Last active April 22, 2021 14:05
Allows you to place form fields anywhere on the page
<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 June 17, 2016 20:06
Make element appear on timer.

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);
@victorzen
victorzen / Error message disappears.md
Last active October 17, 2016 18:21
Error message disappears when clicked or after a few seconds

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 March 31, 2017 21:02
Give phone numbers any format in the form field

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 April 16, 2016 01:00
Limit the number of characters allowed in a form field.

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.