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. They may not work on all Hubs, or may cause unexpected behavior. Before implementing a Hub Hack on a production Hub, we strongly recommending testing it in a safe environment (such as a staging Hub) if possible.

Uberflip Support is not able to help troubleshoot issues with Hub Hacks: if a Hub Hack is not working correctly in your Hub, Uberflip Support can only help you to disable it.

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.