Created
February 4, 2010 13:52
-
-
Save mazuhl/294633 to your computer and use it in GitHub Desktop.
jQuery script and accompanying CSS to pull in favicons for URLs
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
$(document).ready(function(){ | |
jQuery('a.rss-item').filter(function(){ | |
return this.hostname && this.hostname !== location.hostname; | |
}).each(function() { | |
var link = jQuery(this); | |
link.css('backgroundImage', 'url(' + 'http://s2.googleusercontent.com/s2/favicons?domain_url=' + escape('http://' + this.hostname) + ')'); | |
}); | |
}); |
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
.rss-box { | |
border: 2px solid #009BBA; | |
padding-right: 10px; | |
-moz-border-radius: 5px; | |
-webkit-border-radius: 5px; | |
} | |
.rss-items { | |
padding: 10px; | |
margin: 0px; | |
list-style-type: none; | |
} | |
li.rss-item { | |
border-bottom: 1px solid #CCC; | |
margin-bottom: 10px; | |
padding-bottom: 10px; | |
} | |
.rss-item a { | |
text-decoration: none; | |
font-size: larger; | |
font-weight: bold; | |
padding-left: 20px; | |
background: url('http://s2.googleusercontent.com/s2/favicons') left center no-repeat; | |
} | |
.rss-item a:hover { text-decoration: underline; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment