Skip to content

Commit

Permalink
change $.bind to $.on where supported, closes #120 and #145
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Feb 19, 2017
1 parent ab31d58 commit e468ae9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jquery.matchHeight.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down

0 comments on commit e468ae9

Please sign in to comment.