mirror of
https://github.com/wezm/wezm.net.git
synced 2024-11-18 21:02:46 +00:00
24 lines
744 B
JavaScript
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?20111208',
|
|
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);
|
|
});
|