Last active
January 4, 2016 15:19
-
-
Save ara303/8639749 to your computer and use it in GitHub Desktop.
My config for StyleHatch's jQuery plugin for Tumblr Photosets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{block:Photoset} | |
<div class="media{block:Caption} has-caption{/block:Caption}"> | |
<div class="photoset-grid" data-layout="{PhotosetLayout}" style="visibility: hidden;"> | |
{block:Photos} | |
<img src="{PhotoURL-500}" {block:HighRes}data-highres="{PhotoURL-HighRes}"{/block:HighRes} data-width="{PhotoWidth-HighRes}" data-height="{PhotoHeight-HighRes}" {block:Caption}alt="{Caption}"{/block:caption} /> | |
{/block:Photos} | |
</div> | |
</div> | |
{block:Caption} | |
<div class="inner"> | |
<div class="body"> | |
{Caption} | |
</div> | |
</div> | |
{/block:Caption} | |
{/block:Photoset} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.photoset-grid').photosetGrid({ | |
gutter: '10px', | |
rel: 'photoset-item', | |
onComplete: function(){ | |
$('.photoset-grid').attr('style',''); | |
} | |
}); | |
$('.photoset-grid').each(function(){ | |
var photosetImages = $(this).find('img'); | |
var photosetPackage = []; | |
for(i = 0; i < photosetImages.length; i++) { | |
photosetImages.eq(i).attr('data-count',i+1); | |
} | |
$(this).find('img').each(function(){ | |
var packagePart = { | |
width: $(this).data('width'), | |
height: $(this).data('height'), | |
low_res: $(this).attr('src'), | |
high_res: $(this).data('highres') | |
}; | |
photosetPackage.push(packagePart); | |
$(this).on('click',function(){ | |
Tumblr.Lightbox.init(photosetPackage,$(this).data('count')); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment