Created
May 26, 2012 16:12
-
-
Save pdewouters/2794478 to your computer and use it in GitHub Desktop.
favicon bullet
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
function getDomain(url) { | |
return url.match(/:\/\/(.[^/]+)/)[1]; | |
} | |
$("a[href^='http']").each(function() { | |
$(this).css({ | |
background: "url(http://www.google.com/s2/u/0/favicons?domain=" + getDomain(this.href) + | |
") 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