-
-
Save omidnasri/4008c480352d1955114a718e1d9f8687 to your computer and use it in GitHub Desktop.
jQuery: Display favicon next to external link
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
$("a[href^='http']").each(function() { | |
$(this).css({ | |
background: "url(http://www.google.com/s2/u/0/favicons?domain=" + this.hostname + | |
") left center no-repeat", | |
"padding-left": "20px" | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment