-
-
Save Balya/c29a7620efdebd5470d820f241c6090b 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
jQuery(document).ready(function() { | |
jQuery("article a[href*='//']:not([href*='" + document.location.hostname + "']):not(:has(*))").each(function() { | |
jQuery(this).css({ | |
background: "url(http://www.google.com/s2/favicons?domain=" + this.hostname + ") left center no-repeat", | |
"padding-left": "22px" | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment