Created
July 8, 2011 03:39
-
-
Save leereilly/1071084 to your computer and use it in GitHub Desktop.
Coderwall Badge Script for Blogs (or any other Web Page)
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
<script> | |
// This is a fork of https://gist.github.com/1005886 | |
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/"; | |
} | |
); | |
}); | |
}); | |
}); | |
</script> | |
<div id="coderwall"> | |
<h2>Coderwall</h2> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> | |
<script src="http://dev.neosource.cl/javascripts/coderwall.js"></script> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment