Created
May 13, 2013 10:41
-
-
Save Jursdotme/5567472 to your computer and use it in GitHub Desktop.
This little script hels you controle heights on objects in responsive designs.
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 highest = 0; | |
function sortNumber(a,b) { | |
return a - b; | |
} | |
function maxHeight() { | |
var heights = new Array(); | |
$('.fixheight>li').each(function(){ | |
$(this).css('height', 'auto'); | |
heights.push($(this).height()); | |
heights = heights.sort(sortNumber).reverse(); | |
}); | |
highest = heights[0]; | |
$('.fixheight>li').each(function(){ | |
$(this).css('height', highest); | |
}); | |
} | |
$(document).ready(function() { | |
maxHeight(); | |
}) | |
$(window).resize(maxHeight); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment