Last active
August 29, 2015 14:15
-
-
Save bgaeddert/3ac60fb2813ee8766ade to your computer and use it in GitHub Desktop.
Revisions
-
bgaeddert renamed this gist
May 28, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
bgaeddert created this gist
Feb 17, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ // For use with jQuery // Example equalize_heights('.row .box') // This will make all the .box elements the same height. function equalize_heights(elem){ // Get an array of all element heights var elementHeights = $(elem).map(function() { return $(this).height(); }).get(); // Math.max takes a variable number of arguments // `apply` is equivalent to passing each height as an argument var maxHeight = Math.max.apply(null, elementHeights); // Set each height to the max height $(elem).height(maxHeight); return $(elem); }