Skip to content

Instantly share code, notes, and snippets.

@Riaan-ZA
Created June 11, 2013 14:35
Show Gist options
  • Save Riaan-ZA/5757329 to your computer and use it in GitHub Desktop.
Save Riaan-ZA/5757329 to your computer and use it in GitHub Desktop.
Jquery - Set all floated columns to height equal to highest column
$(document).ready(function() {
setHeight('.col');
});
var maxHeight = 0;
function setHeight(column) {
//Get all the element with class = col
column = $(column);
//Loop all the column
column.each(function() {
//Store the highest value
if($(this).height() > maxHeight) {
maxHeight = $(this).height();;
}
});
//Set the height
column.height(maxHeight);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment