Skip to content

Instantly share code, notes, and snippets.

@thesmith
Created July 13, 2010 22:14
Show Gist options
  • Save thesmith/474626 to your computer and use it in GitHub Desktop.
Save thesmith/474626 to your computer and use it in GitHub Desktop.
<html>
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
var addItem = function(item, i) {
var left = (i*200) % $("body").width();
var top = Math.floor(Math.random() * 500);
$("<img/>").css({ position: 'absolute', left: left, top: top, opacity: 0, width: 100}).attr("src", item.thumbnail).appendTo("body").animate({
opacity: 1,
width: '200'
}, 4000, function() {
$(this).animate({
opacity: 0,
}, 3000, function() {
$(this).remove();
});
});
}
$.getJSON("http://atlasapi.org/2.0/brands.json?playlist.uri=http://www.channel4.com/programmes/4od/highlights&callback=?",
function(data) {
$.each(data.playlists, function(i,playlist) {
setTimeout(function() { addItem(playlist.items[0], i); }, i * 200);
});
}
);
</script>
</html>
<html>
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script>
var addItem = function(item, i) {
var left = (i*200) % $("body").width();
var top = Math.floor(Math.random() * 500);
$("<img/>").css({ position: 'absolute', left: left, top: top, opacity: 0, width: 100}).attr("src", item.thumbnail).appendTo("body").animate({
opacity: 1,
width: '200'
}, 4000, function() {
$(this).animate({
opacity: 0,
}, 3000, function() {
$(this).remove();
});
});
}
$.getJSON("http://atlasapi.org/2.0/brands.json?item.genre=http://ref.atlasapi.org/genres/atlas/entertainment&limit=100&callback=?",
function(data){
$.each(data.playlists, function(i,playlist) {
setTimeout(function() { addItem(playlist.items[0], i); }, i * 200);
});
});</script>
</html>
<html>
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script>
var addItem = function(item, i) {
var left = (i*200) % $("body").width();
var top = Math.floor(Math.random() * 500);
$("<img/>").css({ position: 'absolute', left: left, top: top, opacity: 0, width: 100}).attr("src", item.thumbnail).appendTo("body").animate({
opacity: 1,
width: '200'
}, 4000, function() {
$(this).animate({
opacity: 0,
}, 3000, function() {
$(this).remove();
});
});
}
$.getJSON("http://atlasapi.org/2.0/items.json?playlist.uri=http://ref.atlasapi.org/mentions/twitter&limit=200&callback=?",
function(data){
$.each(data.items, function(i,item) {
setTimeout(function() { addItem(item, i); }, i * 200);
});
});</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment