Skip to content

Instantly share code, notes, and snippets.

@SkyronDevelopers
Created July 11, 2012 17:09
Show Gist options
  • Save SkyronDevelopers/3091782 to your computer and use it in GitHub Desktop.
Save SkyronDevelopers/3091782 to your computer and use it in GitHub Desktop.
js: equalheight_plugin
/**
* @title: Equal Height
* @version:2.0
* @author: Andreas Lagerkvist
* @date: 2008-09-16
* @url: http://andreaslagerkvist.com/jquery/equal-height/
* @license: http://creativecommons.org/licenses/by/3.0/
* @copyright: 2008 Andreas Lagerkvist (andreaslagerkvist.com)
**/
jQuery.fn.equalHeight=function(){var height=0;var maxHeight=0;this.each(function(){height=jQuery(this).outerHeight();maxHeight=(height>maxHeight)?height:maxHeight});return this.each(function(){var t=jQuery(this);var minHeight=maxHeight-(t.outerHeight()-t.height());var property=jQuery.browser.msie&&jQuery.browser.version<7?'height':'min-height';t.css(property,minHeight+'px')})};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment