I'm working with this piece of code
$('.gallery').each(function(){
var thumbCount = $(this).find('.ngg-gallery-thumbnail-box').size();
var rows = thumbCount/5;
var height = rows*145;
$(this).css({'height':height+24});
});
This function calculates the height of each .gallery
div. Now, I want to take it a step further and add up all those height
values from within the each function (to get the total height for all .gallery divs) but I'm not sure how to do that.
Can someone please demonstrate the correct syntax for achieving this?
Thank you!