Skip to content

Instantly share code, notes, and snippets.

@Jursdotme
Created May 13, 2013 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jursdotme/5567472 to your computer and use it in GitHub Desktop.
Save Jursdotme/5567472 to your computer and use it in GitHub Desktop.
This little script hels you controle heights on objects in responsive designs.
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