I have this function
$('.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});
});
Which gets the height of each .gallery div. I want to go one step further and take all of those height variables from inside the each function and add them together (getting the total height for all .gallery divs)– but I don’t know how.
Could someone show me the proper syntax for this?
Thanks!
With your current code:
BTW, here’s how I might simplify your existing code a wee bit: