drifterz28
12/12/2012 - 2:39 PM

set a like group of tags to equal heights.

set a like group of tags to equal heights.

$.fn.equalHeights = function(addheight,effect,callback){
  var div = $(this);
  var divHeight = 0;
  $(div).each(function(){
    if($(this).height() > divHeight){
      divHeight = $(this).height();
    }
  });
  if(effect === ''){ effect = 'linear'; }
  if(addheight == undefined){ addheight = 0; }
  $(div).animate({'height':divHeight+addheight},400,effect,callback);
}