Use jQuery/CSS to find the tallest of all elements - Stack Overflow


/ Published in: jQuery
Save to your folder(s)

$(document).ready(function() {
var maxHeight = -1;

$('.features').each(function() {
maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height();
});

$('.features').each(function() {
$(this).height(maxHeight);
});
});


Copy this code and paste it in your HTML
  1. $(document).ready(function() {
  2. var maxHeight = -1;
  3.  
  4. $('.features').each(function() {
  5. maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height();
  6. });
  7.  
  8. $('.features').each(function() {
  9. $(this).height(maxHeight);
  10. });
  11. });

URL: http://stackoverflow.com/questions/6781031/use-jquery-css-to-find-the-tallest-of-all-elements

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.