Advertisement
Guest User

PhotoSlide

a guest
Feb 27th, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 1.15 KB | None | 0 0
  1.     // Iframe Photoset Slideshow Shit FUCKED UP!
  2.     $('iframe.photoset').load(function() {
  3.  
  4.         var html = [];
  5.         var photo_post = $('.html_photoset').parent().parent();
  6.         photo_post.hide();
  7.         console.log(photo_post);
  8.        
  9.         // Construct Photos
  10.         $(this).contents().find('.photoset_photo').each(function(index) {
  11.             var anchor_url = $(this).attr('href');
  12.             var image = $(this).find('img');
  13.             var image_url = $(this).find('img').attr('src');
  14.             html.push('<div><a href="' + anchor_url +'"><img src="' + image_url + '"></a></div>');
  15.         });
  16.        
  17.         // Set Height of Container
  18.         $('.html_photoset').html(html.join('')).show('1', function() {
  19.             photo_post.show();
  20.             var height = $(this).find('img').first().height();
  21.             $(this).css('height', height);
  22.         });
  23.  
  24.         //  Resize on Resize
  25.         $(window).resize(function(){
  26.             var height = $('.html_photoset').find('img').first().height();
  27.             $('.html_photoset').css('height', height);
  28.         });
  29.  
  30.         // Slideshow Photos Props CSS Tricks
  31.         $(".html_photoset > div:gt(0)").hide();
  32.         setInterval(function() {
  33.             $('.html_photoset > div:first').fadeOut(1000).next().fadeIn(1000).end().appendTo('.html_photoset');
  34.         }, 3000);
  35.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement