Trying to get jquery cycle to work with tumblr photoset, as the photoset images and the div '.html_photoset' are loaded dynamically with the each function, the cycle cant pick up the div '.html_photoset'
$(function(){
$('.html_photoset').cycle({ fx: 'fade' });
$('.html_photoset').each(function() {
var tumblr_post_id = $(this).attr('id').split('_')[1];
$(this).empty();
var this_photoset = this;
$.getJSON('/api/read/json?id='+ tumblr_post_id +'&callback=?', function(response){
var photos = response['posts'][0]['photos'];
$.each(photos, function() {
var photo_url = this['photo-url-1280'];
var photo_caption = this['caption'];
var photo_markup = '<img src="'+ photo_url +'"/>';
$(this_photoset).append(photo_markup);
});
});
});
});