From e468ae9089e9476c2349be4b00e5cb49987e659b Mon Sep 17 00:00:00 2001 From: liabru Date: Sun, 19 Feb 2017 18:04:25 +0000 Subject: [PATCH] change $.bind to $.on where supported, closes #120 and #145 --- jquery.matchHeight.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jquery.matchHeight.js b/jquery.matchHeight.js index ab24d45..99869be 100644 --- a/jquery.matchHeight.js +++ b/jquery.matchHeight.js @@ -372,13 +372,16 @@ // apply on DOM ready event $(matchHeight._applyDataApi); + // use on or bind where supported + var on = $.fn.on ? 'on' : 'bind'; + // update heights on load and resize events - $(window).bind('load', function(event) { + $(window)[on]('load', function(event) { matchHeight._update(false, event); }); // throttled update heights on resize events - $(window).bind('resize orientationchange', function(event) { + $(window)[on]('resize orientationchange', function(event) { matchHeight._update(true, event); });