1

Facing problem while resizing browser. equal_height function not working on resizing browser

$(document).ready(function(){  
  function equal_height(){  
    var secHeight = $(".innter-con").map(function(){
      return $(this).height();
    });
    maxHeight=Math.max.apply(null, secHeight);
    $(".innter-con").height(maxHeight);
  }

  equal_height();

  $(window).resize(function(){
    equal_height(); 
  });
});
Niko
  • 3,412
  • 26
  • 35
maheshv13
  • 133
  • 9

1 Answers1

0

Here is the modified code it works on load as well as on browser resize: https://jsfiddle.net/maheshv13/0omv6z0e/2/

function equalHeight(){
        $(".equalHeight").each(function(){
        var findHeight = $(this).height();
        var maxHeight = Math.max.apply(Math, $(this).map(function(){
        $(this).height('100%');
        return $(this).height();
    }));
    $(".equalHeight").height(maxHeight);
    });
    }
    $(window).resize(function(){
        equalHeight();
    }); 
        equalHeight();
maheshv13
  • 133
  • 9