
PhotoSlide
By: a guest on
Feb 27th, 2012 | syntax:
jQuery | size: 1.15 KB | hits: 61 | expires: Never
// Iframe Photoset Slideshow Shit FUCKED UP!
$('iframe.photoset').load(function() {
var html = [];
var photo_post = $('.html_photoset').parent().parent();
photo_post.hide();
console.log(photo_post);
// Construct Photos
$(this).contents().find('.photoset_photo').each(function(index) {
var anchor_url = $(this).attr('href');
var image = $(this).find('img');
var image_url = $(this).find('img').attr('src');
html.push('<div><a href="' + anchor_url +'"><img src="' + image_url + '"></a></div>');
});
// Set Height of Container
$('.html_photoset').html(html.join('')).show('1', function() {
photo_post.show();
var height = $(this).find('img').first().height();
$(this).css('height', height);
});
// Resize on Resize
$(window).resize(function(){
var height = $('.html_photoset').find('img').first().height();
$('.html_photoset').css('height', height);
});
// Slideshow Photos Props CSS Tricks
$(".html_photoset > div:gt(0)").hide();
setInterval(function() {
$('.html_photoset > div:first').fadeOut(1000).next().fadeIn(1000).end().appendTo('.html_photoset');
}, 3000);
});