Skip to content

Instantly share code, notes, and snippets.

@sophy
Created November 29, 2013 06:51
Show Gist options
  • Save sophy/7702364 to your computer and use it in GitHub Desktop.
Save sophy/7702364 to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>FB Gload</title>
<link rel="stylesheet" href="css/fbgload.css">
<style>
#goald {
width: 100%;
}
#goald .metter {
width: 0;
background: #00f;
height: 25px;
}
</style>
</head>
<body>
<div id="goald"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(function() {
var gold = 1000;
$.getJSON('http://graph.facebook.com/?id=https://www.facebook.com/ohkhmerdotcom')
.done(function(data) {
var likes = data.likes;
var bgPercentag = (likes * 100) / gold;
$('#goald').append('<div class="liked">' + likes + ' of ' + gold + '</div><div class="metter"/>')
$('#goald .metter').animate({
'width': bgPercentag + '%'
}, 5000);
})
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment