Created
July 4, 2009 05:50
-
-
Save Lytol/140481 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$(document).ready(function(){ | |
// Add a favicon to all links with class name favicon | |
// | |
$("a.favicon").each(function() { | |
this.style.paddingLeft = '25px'; | |
this.style.background = 'transparent url(' + faviconFromLink(this) + ') no-repeat top left'; | |
}); | |
}); | |
function faviconFromLink(link) { | |
var googleFaviconBaseURL = "http://www.google.com/s2/favicons?domain="; | |
return (googleFaviconBaseURL + link.hostname); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment