I am in the process of developing a gallery tab for a website, initially displaying three thumbnails. The goal is to reveal the remaining thumbnails when a class named show-all
is clicked. I have successfully animated the gallery's height to show the hidden content. However, I am encountering an issue where even after hiding the excess thumbnails using overflow:hidden
, parts of the second row are still visible. I want them completely hidden. Below is my code block:
HTML
<div class="gallery">
<h3>Photos</h3>
<a class="see-all" href="javascript:void(0)">See All</a>
<div class="clear"></div>
<div class="row">
<div class="col-xs-4">
<div class="thumbnail">
<img src="http://placekitten.com/g/150/150">
</div>
</div>
<div class="col-xs-4">
<div class="thumbnail">
<img src="http://placekitten.com/g/150/150">
</div>
</div>
(remaining thumbnail divs here)
</div>
</div>
Jquery
$('.see-all').click(function(){
$(this).parents('.gallery').animate({height: $(".gallery").get(0).scrollHeight}, 1000);
});
Any assistance would be greatly appreciated.
NOTE: I am unable to change the height of the gallery due to variations in image sizes.