Basic Equalize Heights Plugin


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

A basic plugin to equalize the heights of a collection of elements.


Copy this code and paste it in your HTML
  1. // Usage: $( elements ).equalHeights();
  2. (function($){
  3. $.fn.equalHeights = function() {
  4. var max = 0;
  5. return this
  6. .each(
  7. function(){
  8. max = Math.max( max, $(this).height() );
  9. })
  10. .css({
  11. 'height': max
  12. });
  13. };
  14. })(this.jQuery);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.