Created
March 19, 2016 22:58
-
-
Save alexeightsix/2fa78a6e5ff54636e287 to your computer and use it in GitHub Desktop.
add2any font awesome
This file contains 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
/* 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