Created
September 26, 2013 01:15
-
-
Save stowball/6708527 to your computer and use it in GitHub Desktop.
Improved "perceived" performance of AddThis
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
| .addthis_toolbox, .addthis_toolbox iframe { | |
| visibility: hidden !important; | |
| } | |
| .addthis-loaded .addthis_toolbox, .addthis-loaded .addthis_toolbox iframe { | |
| visibility: visible !important; | |
| } |
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
| // Run after addthis include, on domready or similar | |
| if (addthis) { | |
| var addthisLoaded = function() { | |
| window.setTimeout(function() { | |
| document.documentElement.className += ' addthis-loaded'; | |
| }, 2000); // Magic number | |
| }; | |
| if (addthis.addEventListener) | |
| addthis.addEventListener('addthis.ready', addthisLoaded); | |
| else if (addthis.attachEvent) | |
| addthis.attachEvent('onaddthis.ready', addthisLoaded); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment