Skip to content

Instantly share code, notes, and snippets.

View noahub's full-sized avatar
💻
Doing computer stuff

Noah noahub

💻
Doing computer stuff
View GitHub Profile
@noahub
noahub / FixedHeaderOrFooterMenu.md
Created September 8, 2016 19:31 — forked from johnnyopao/FixedHeaderOrFooterMenu.md
Centered fixed header or footer menu on Unbounce (Set placement to 'before body end tag')
@noahub
noahub / dropdownformconfirmationurl.md
Created September 8, 2016 19:30 — forked from johnnyopao/dropdownformconfirmationurl.md
Change form destination URL by dropdown selection on Unbounce
  1. Be sure to first change your forms confirmation to 'Goto another webpage' and set a default fallback URL

  2. Drop this script into your javascript box. Set the placement to 'before body end tag'

<script>

$("#gender").live('change', function() {
 
 switch ($(this).val()) {
@noahub
noahub / image-text-URL-params.html
Created April 1, 2016 18:49 — forked from johnnyopao/image-text-URL-params.html
Carry over URL parameters to text and image links on Unbounce
<script>
$(function() {
$('.lp-pom-image a, .lp-pom-text a').not('a[href^=#]').each( function() {
this.href = this.href + window.location.search;
});
});
</script>
@noahub
noahub / 0_reuse_code.js
Created January 27, 2016 22:41
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@noahub
noahub / Add line break to button label
Created December 23, 2015 22:58 — forked from megub/Add line break to button label
Add line break to button label
<script>
$('#lp-pom-button-251').html('<span class="label">Push to Call<br>1-855-884-1381</span>')
</script>
@noahub
noahub / redirect-form-confirmation-from-pop-up
Created December 23, 2015 22:51 — forked from megub/redirect-form-confirmation-from-pop-up
Redirect Thank you page/form confirmation dialog from pop up
To be placed on form confirmation/thank you page in head
<script>
if ( window.self !== window.parent ) window.parent.location.href = window.location.href;
</script>
@noahub
noahub / updated-external-conversion-tracking
Created December 22, 2015 21:03 — forked from megub/updated-external-conversion-tracking
Updated External Conversion Tracking - to work with WP domains
<script type="text/javascript">
var _ubaq = _ubaq || [];
_ubaq.push(['trackGoal', 'convert']);
(function() {
function UnbounceAnalytics(commands) {
this.trackingUrl =
('https:' == document.location.protocol ? 'https://' : 'http://') +
"t.unbounce.com/trk"+"?";
this.commands = commands;
<script>
// unbounce-horizontal-forms 7453328
function HorizontalForm(a,b){var c=this;this.spacing=a,this.submitPlacement=b,this.$=window.lp.jQuery,this.$(function(){c.$form=c.$(".lp-pom-form").eq(0),c.$fields=c.$("div.lp-pom-form-field"),c.$button=c.$(".lp-pom-form .lp-pom-button").eq(0),"manual"!==c.submitPlacement&&(c.$fields=c.$fields.add(c.$button)),c.doLayout()}),this.$(window).resize(function(){c.doLayout()})}HorizontalForm.prototype.doLayout=function(){for(var a=this.$fields.eq(0).width()+this.spacing,b=this.$fields.eq(0).height(),c=this.$form.parent().width()-this.$form.position().left,d=0,e=0,f=0;f<this.$fields.length;f++){field=this.$fields.eq(f),e=0===f?e:e+a,e+a>c&&(d=0===f?d:d+b+this.spacing,e=0,b=field.height());var g=d;if(field.is(".lp-pom-button"))if("newline"===this.submitPlacement)g=d+b+spacing,e=0;else{g=d+19;var h=this.$form.find(":text").eq(0).height();field.css("height",h-1+"px")}else this.$(field).children("label").length||(g=d+19);field.css({top:g+"px",left:e+"px"}),field.height(
<script>
window.module.lp.form.data.validationRules['field_name'].digits = true;
</script>

Replace 'field_name' with the ID of your form field you want to add this validation to.