1
0
Fork 0
forked from wezm/wezm.net
wezm.net/output/js/home.js
2012-01-21 17:15:42 +11:00

24 lines
744 B
JavaScript

jQuery(function () {
var image_template = Handlebars.compile($('#image-template').html());
function populate_flickr(data, text_status) {
var ul = $("#flickr ul");
ul.empty();
jQuery.each($('photo', data), function(i, obj) {
var photo = $(obj);
var image = {
href: photo.attr('url_z'),
src: '/images/photos.jpg?20120121',
alt: photo.attr('title')
};
var li = $(image_template(image));
$('img', li).css('left', (i * -75) + 'px');
li.css("background-position", (i * -75) + 'px -75px');
ul.append(li);
});
$("a[rel^='prettyPhoto']").prettyPhoto({theme: "facebook"});
};
// Populate Flickr
jQuery.get("/photos.xml?20111208", {}, populate_flickr);
});