Equal height using Jquery


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



Copy this code and paste it in your HTML
  1. jQuery(document).ready(function($) {
  2.  
  3. // equal height
  4.  
  5. function equalHeight(group) {
  6. var tallest = 0;
  7. group.each(function() {
  8. var thisHeight = $(this).height();
  9. if(thisHeight > tallest) {
  10. tallest = thisHeight;
  11. }
  12. });
  13. group.height(tallest);
  14. }
  15.  
  16. equalHeight($(".head-lines-item"));
  17.  
  18. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.