Skip to content

Instantly share code, notes, and snippets.

@nikhilatjumpcut
Last active August 5, 2019 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhilatjumpcut/e59e442092e1e310d9fa31a908a7bb6e to your computer and use it in GitHub Desktop.
Save nikhilatjumpcut/e59e442092e1e310d9fa31a908a7bb6e to your computer and use it in GitHub Desktop.
vaCTADelayScript.js
(function vaCTADelayScript() {
var funnelAccess = window.__TSUNAMI__.funnelAccess;
var currentStep = funnelAccess.find(function(access) {
if (access.isCurrentStep) {
return true;
}
return false;
});
$ctaBlocks = $("[data-title='cta-block']");
$ctaSection = $('#section--37511');
$ctaSection.attr('style', $ctaSection.attr('style') + 'display:none;');
$ctaBlocks.each(function() {
$(this).attr('style', $(this).attr('style') + 'display:none;');
});
var LOCAL_STORAGE_KEY = 'show_va_cta';
var CTA_TIMEOUT = 33 * 60 * 1000;
var ctaBlocks = $('[data-title=cta-block], #section--37511');
var ctaHeader = $('#section--33797');
var shouldShowCTA = localStorage.getItem(LOCAL_STORAGE_KEY) === 'true';
if (shouldShowCTA) {
ctaBlocks.show();
return;
}
ctaHeader.css('min-height', '100vh');
localStorage.setItem(LOCAL_STORAGE_KEY, 'true');
setTimeout(function() {
ctaBlocks.fadeIn();
ctaHeader.css('min-height', 'auto');
}, CTA_TIMEOUT);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment