Skip to content

Instantly share code, notes, and snippets.

@indexzero
Created June 4, 2011 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indexzero/1007631 to your computer and use it in GitHub Desktop.
Save indexzero/1007631 to your computer and use it in GitHub Desktop.
Coderwall Badge Script for Blogs (or any other Web Page)
/*
*
* coderwall.js
*
* Code to display coderwall.com badges
*
*/
var coderwallJSONurl ="http://www.coderwall.com/hermanjunge.json?callback=?";
var height = 75;
var width = 75;
$(document).ready(function(){
$.getJSON(coderwallJSONurl, function(data) {
$.each(data.data.badges, function(i, item) {
$("<img/>").attr("src", item.badge)
.attr("float", "left")
.attr("title", item.name + ": " + item.description)
.attr("alt", item.name)
.attr("height", height)
.attr("width", width)
.appendTo("#coderwall")
.hover(
function(){
$(this).css("opacity","0.6");
},
function(){
$(this).css("opacity","1.0");
}
)
.click(
function(){
window.location = "http://www.coderwall.com/hermanjunge/";
}
);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment