Get cumulative height

Get cumulative height

Hi Guys,

I'm trying to get the cumulative height of li elements & set the parent ht, as it's being clipped.

Tried:

  1. var outht = 0;
  2. var myli = $('#searcher_stack-its_outerhtml li[id^="order"]:visible');
  3. var maincnt = $('#searcher_stack-its_outerhtml li[id^="order"]:visible').length;
  4. for (var mcnt = 0; mcnt<maincnt; mcnt++) {
  5.    var fcnt = mcnt + 1;
  6.    if ($(myli[mcnt]).css('clear') == "left") {outht = outht + $(myli[mcnt]).outerHeight(true)}
  7.    console.log('Main Outer Height: ' + outht);
  8.    if (fcnt == maincnt) {$(this).parent().css({'height': outht + 'px'})}

Getting 0 for outht.  What am I doing wrong?

Thanks,  Bill