Skip to content

Instantly share code, notes, and snippets.

@GaryUnbounce
GaryUnbounce / FullBackgorund
Created February 18, 2014 22:41
Make a background image scale the full page
<style type="text/css">
#lp-pom-root {
-webkit-background-size: cover !important;
-moz-background-size: cover !important;
-o-background-size: cover !important;
background-size: cover !important;
}
</style>
@GaryUnbounce
GaryUnbounce / FancyBox_web
Last active August 29, 2015 13:56
Button link to open a lightbox (iframe) webpage
<script>
$(document).ready(function() {
$('#lp-pom-button-22').fancybox({
type: 'iframe',
width: 840,
height: 480
});
});
</script>
@GaryUnbounce
GaryUnbounce / NoUnderline
Created February 18, 2014 22:49
Remove the underline from text links
<style type="text/css">
#lp-pom-root .lp-pom-text a:link {text-decoration: none}
#lp-pom-root .lp-pom-text a:visited {text-decoration: none}
#lp-pom-root .lp-pom-text a:active {text-decoration: none}
#lp-pom-root .lp-pom-text a:hover {text-decoration: none}
</style>
@GaryUnbounce
GaryUnbounce / ReferrerData
Last active August 29, 2015 13:56
Capture referrer data
<script type="text/javascript">
jQuery(function(){
jQuery('input#referrer').val(decodeURI(document.referrer));
});
</script>
@GaryUnbounce
GaryUnbounce / KISSMetrics
Created February 18, 2014 22:58
Add KISSMetrics event tracking
<script type="text/javascript">
var getUrlParams = function () {
var params = {},
hash;
var hashes = decodeURI(window.location.href).replace(/\+/g," ").slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
params[hash[0]] = unescape(hash[1]);
}
return params;
<script>
$( '.lp-pom-form .lp-pom-button' ).click(function() {
if (lp.jQuery('form').valid() == true) {
_gaq.push(['_trackEvent', 'form', 'button', 'submit']);
}
});
</script>