Skip to content

Instantly share code, notes, and snippets.

@sloped
Created July 2, 2012 21:42
Show Gist options
  • Save sloped/3035893 to your computer and use it in GitHub Desktop.
Save sloped/3035893 to your computer and use it in GitHub Desktop.
Addthis Async and conditional load script
if(jQuery('.namespace_addthis').length > 0) {
jQuery.ajaxSetup({cache: true});
jQuery(window).load(function(){jQuery.getScript('//s7.addthis.com/js/250/addthis_widget.js#pubid=', true);});
jQuery(".namespace_addthis").each(function() {
jQuery(this).html('<div class="addthis_toolbox addthis_default_style addthis_32x32_style" ><a class="addthis_button_facebook"></a><a class="addthis_button_twitter"></a><a class="addthis_button_email"></a> <a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a></div>');
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment