Skip to content

Instantly share code, notes, and snippets.

@NickDeckerDevs
Created August 23, 2018 22:35
Show Gist options
  • Select an option

  • Save NickDeckerDevs/dba561e73b72e038e86b1c8ea58751aa to your computer and use it in GitHub Desktop.

Select an option

Save NickDeckerDevs/dba561e73b72e038e86b1c8ea58751aa to your computer and use it in GitHub Desktop.
// window load waits until after CTAs and forms are in DOM
$(window).load(function() {
// check to see if this exists on the page by checking out how many exist
if($('.post-footer-cta-wrapper #cta_button_112139_572acb38-75c4-4b31-ba14-d52e28378911').length > 0) {
//set up click event handler
$('.post-footer-cta-wrapper #cta_button_112139_572acb38-75c4-4b31-ba14-d52e28378911').on('click', function() {
// after being clicked we return false, preventing the default behavior of the element.
// in this case it is a link, so it prevents the link from functioning
return false;
});
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment