Created
June 11, 2013 14:35
-
-
Save Riaan-ZA/5757329 to your computer and use it in GitHub Desktop.
Jquery - Set all floated columns to height equal to highest column
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 characters
$(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