Forked from Balya/gist:c29a7620efdebd5470d820f241c6090b
Created
December 19, 2016 18:19
-
-
Save omidnasri/1d894550c5d582ffa8c0e64d8a5e73f6 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