Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Created October 16, 2013 16:10
Show Gist options
  • Select an option

  • Save ryaan-anthony/7010472 to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/7010472 to your computer and use it in GitHub Desktop.
(function(b){b.fn.equalHeightColumns=function(a){var c,d,a=b.extend({},b.equalHeightColumns.defaults,a);c=a.height;d=b(this);b(this).each(function(){a.children&&(d=b(this).children(a.children));a.height||(a.children?d.each(function(){b(this).height()>c&&(c=b(this).height())}):b(this).height()>c&&(c=b(this).height()))});a.minHeight&&c<a.minHeight&&(c=a.minHeight);a.maxHeight&&c>a.maxHeight&&(c=a.maxHeight);d.animate({height:c},a.speed);return b(this)};b.equalHeightColumns={version:1,defaults:{children:!1, height:0,minHeight:0,maxHeight:0,speed:0}}})(jQuery);
// example use:
// $('.sub-menu > li').equalHeightColumns();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment