Find Smallest height in jQuery

Find small height in jQuery

var allDivs = jQuery('.gallery_thumb img');
var dvSmallest = allDivs[0];
$(allDivs).each(function() {
if($(this).height() < $(dvSmallest).height()){
dvSmallest = jQuery(this);
};
});
$('.gallery_thumb').css('height', dvSmallest.height());

Leave a Reply

Your email address will not be published. Required fields are marked *