Created
January 6, 2021 01:45
-
-
Save tartakynov/7131e4446999b58256f209e61ff2ee61 to your computer and use it in GitHub Desktop.
Enable Pinterest's save button on all images in Squarespace page except the social block (Instagram)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script async defer data-pin-hover="true" data-pin-tall="true" data-pin-lang="en" src="//assets.pinterest.com/js/pinit.js"></script> | |
<script> | |
(function() { | |
function preventPinterestOnInstagramBlock(){ | |
var elems = document.querySelectorAll(".instagram-block img:not([data-pin-no-hover])"); | |
for (var i = 0; i < elems.length; i++) { | |
elems[i].setAttribute("data-pin-no-hover", "true"); | |
} | |
setTimeout(preventPinterestOnInstagramBlock, 500); | |
} | |
window.addEventListener("load", preventPinterestOnInstagramBlock); | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment