Skip to content

Instantly share code, notes, and snippets.

@knation
Created November 10, 2015 19:47
Show Gist options
  • Save knation/09ccf4611f5f44f398d9 to your computer and use it in GitHub Desktop.
Save knation/09ccf4611f5f44f398d9 to your computer and use it in GitHub Desktop.
Infusionsoft / Squarespace Subscribe Popup Form
<span id="custom-subscribe-button" class="sqs-system-button sqs-editable-button" style="float:right;">Subscribe</span>
<div id="custom-subscribe-popup-template" class="yui3-widget sqs-widget sqs-modal-lightbox" style="display:none;">
<div class="sqs-modal-lightbox-content">
<div class="lightbox-background"></div>
<div class="lightbox-inner">
<div class="lightbox-content" style="margin-top: 332.5px; margin-bottom: 332.5px;">
<div class="form-wrapper">
<div class="form-title">Subscribe</div>
<div class="form-inner-wrapper">
<!-- INSERT FORM HERE -->
</div>
</div>
<div class="lightbox-close" onclick="document.getElementById('custom-subscribe-popup').style.display='none';">×</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
(function() {
var pu = document.getElementById('custom-subscribe-popup-template').cloneNode(true);
pu.setAttribute('id', 'custom-subscribe-popup');
document.body.appendChild(pu);
document.getElementById('custom-subscribe-button').onclick=function() {
var y = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
pu.style.display = 'block';
pu.getElementsByClassName('sqs-modal-lightbox-content')[0].style.top = y + 'px';
}
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment