Temporarily Disable 'Download PDF' button on Gated CTAs with Initial Delay

Follow

Use this Custom Code snippet to prevent an end-user from downloading the PDF prior to the delayed gate displaying.


Warning

Hub Hacks are not official Uberflip features.

Hub Hacks may not work on all Hubs, or may cause unexpected behavior. If you experience issues with a Hub Hack, available support is limited to helping you disable the Hub Hack only.

Important

Hub Hacks are not compatible with Front End V2 Hubs.

If you are not sure if your Hub uses Front End V2, see this article for help.

Details

  • Type: CSS & Javascript
  • Placement: Body Bottom

 

Code

<style>
.single-page .uf-disabled {
background: #ddd !important;
color: #fff !important;
pointer-events: none;
}
</style>
<script>
var fixGatedCtas = function fixGatedCtas() {
if ($('.cta[data-init-delay]').length !== 0) {
$('.download-pdf').addClass('uf-disabled');
var ctaDelay = parseInt($('.cta[data-init-delay]').attr('data-init-delay')) * 1000;
setTimeout(function () {
$('.download-pdf').removeClass('uf-disabled');
}, ctaDelay + 2000);
}
};
fixGatedCtas();
</script>

 

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.