Javascript-Equal-Height-Responsive-Rows icon indicating copy to clipboard operation
Javascript-Equal-Height-Responsive-Rows copied to clipboard

Causes scrolling slowness in IE 8

Open sinak opened this issue 11 years ago • 2 comments

I know nobody wants to have to support IE 8, but using the .responsiveEqualHeightGrid method causes window scrolling to become unreasonably jerky.

sinak avatar Aug 02 '14 17:08 sinak

It looks like syncHeights is being called continually, making IE 8 bug out.

sinak avatar Aug 02 '14 18:08 sinak

Okay, so the problem is pretty well documented on Stack Overflow here.

My solution was to change $.fn.responsiveEqualHeightGrid to this:

$.fn.responsiveEqualHeightGrid = function() {
    var _this = this;

    function syncHeights() {
        var cols = _this.detectGridColumns();
        _this.equalHeightGrid(cols);
        setTimeout(resizeListener,100);
      }

    var resizeListener = function(){
      $(window).one('resize load', syncHeights);
    }
    resizeListener();

    syncHeights();
    return this;
  };

})(jQuery);

I'll submit a pull request, though you might want to refactor my code if you don't like this particular solution.

sinak avatar Aug 02 '14 18:08 sinak