From 1b5adb39fc1b9bd7254366a24631bb4b922f41f5 Mon Sep 17 00:00:00 2001 From: Sina Khanifar Date: Sat, 2 Aug 2014 11:51:48 -0700 Subject: [PATCH] Fix for window.bind('resize') loop in old IE As documented here: https://stackoverflow.com/questions/1852751/window-resize-event-firing-in-internet-explorer Fixes #6 --- grids.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/grids.js b/grids.js index 59fac6e..1c2a441 100644 --- a/grids.js +++ b/grids.js @@ -62,10 +62,14 @@ $.fn.responsiveEqualHeightGrid = function() { var _this = this; function syncHeights() { - var cols = _this.detectGridColumns(); - _this.equalHeightGrid(cols); + var cols = _this.detectGridColumns(); + _this.equalHeightGrid(cols); + setTimeout(resizeListener,100); + } + var resizeListener = function(){ + $(window).one('resize load', syncHeights); } - $(window).bind('resize load', syncHeights); + resizeListener(); syncHeights(); return this; };