public
Created

Coderwall Badge Script for Blogs (or any other Web Page)

  • Download Gist
coderwall.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
/*
*
* 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/";
}
);
});
});
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.