Skip to content

Instantly share code, notes, and snippets.

@alexeightsix
Created March 19, 2016 22:58
Show Gist options
  • Save alexeightsix/2fa78a6e5ff54636e287 to your computer and use it in GitHub Desktop.
Save alexeightsix/2fa78a6e5ff54636e287 to your computer and use it in GitHub Desktop.
add2any font awesome
/* https://en-ca.wordpress.org/plugins/add-to-any/ */
/* replaces icons with Font=awesome icons */
$(window).load(function() {
var share = $('.addtoany_share_save_container');
if (share.length === 1) {
var buttons = $('.addtoany_share_save_container').find("a");
share.addClass("share-box");
share.find(".a2a_kit").attr("style", "display:inline");
share.find(".addtoany_header").replaceWith(function() { return "<strong>" + this.innerHTML + "</strong>"; });
$.each(buttons, function() {
var label = $(this).attr("class").split("_")[2];
$(this).attr("style", "display:inline;")
$(this).contents().remove();
$(this).removeAttr("class");
$(this).html('<i class="fa fa-'+label+'"></i>');
});
share.fadeIn();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment