Created
January 29, 2015 21:40
-
-
Save cacheleocode/30682df2817b536f4712 to your computer and use it in GitHub Desktop.
Pinterest article code
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
| {% if LANG == 'en' or LANG == 'ja' %} {# pinterest only translates to english and japanese #} | |
| <script type="text/javascript" async defer data-pin-lang="{{ LANG }}" data-pin-color="red" data-pin-height="28" data-pin-hover="true" src="//assets.pinterest.com/js/pinit.js"></script> | |
| {% else %} {# pinterest without the need to translate #} | |
| <script type="text/javascript" async defer data-pin-shape="round" data-pin-height="32" data-pin-hover="true" src="//assets.pinterest.com/js/pinit.js"></script> | |
| {% endif %} | |
| <script type="text/javascript"> | |
| $(document).ready(function() { | |
| // disable pinterest hover on all images | |
| $("img").attr("data-pin-no-hover", true); | |
| // remove disabling attribute on preferred images | |
| $("#article-header .image img, #article-header #hero img").removeAttr("data-pin-no-hover"); | |
| }); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment