Created
April 9, 2014 15:29
-
-
Save rob-bar/10283279 to your computer and use it in GitHub Desktop.
equal heights
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var helper = { | |
highest: function(selector) { | |
return Math.max.apply(this || window, selector.map(function() { | |
return $(this).innerHeight(); | |
})); | |
}, | |
equalheights: function(selector, highest) { | |
return selector.each(function() { | |
return $(this).css("height", "" + highest + "px"); | |
}); | |
} | |
}; | |
var fixheightsof = $("#left, #right"); | |
helper.equalheights(fixheightsof, helper.highest(fixheightsof)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment