/** * set all passed elements to the same height as the highest element. * * copyright (c) 2012 ewen elder * dual licensed under the mit and gpl licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * @author: ewen elder * @version: 2.0 */ 'use strict'; !function(a){a.equalheightcolumns={version:2},a.equalheightcolumns.defaults={speed:0,height:0,minheight:0,maxheight:0},a.equalheightcolumns.defaults.resize=function(){var d,b=a(this).data("equalheightcolumns.options"),c=+b.height;c||a(this).each(function(){d=a(this).height(),a(this).css("height","auto"),a(this).height()>c&&(c=a(this).height()),a(this).height(d)}),c=b.minheight&&c+b.maxheight?+b.maxheight:c,a(this).animate({height:c},+b.speed)},a.equalheightcolumns.defaults.actions=function(b,c,d){var f,e=a(this).data("equalheightcolumns.options");switch(b){case"option":if(e&&"undefined"!=typeof e[c]){if("undefined"==typeof d)return e[c];e[c]=d,a(this).data("equalheightcolumns.options",e)}return!1;case"destroy":return a(this).removedata("equalheightcolumns.options").each(function(){f=a(this).data("equalheightcolumns.originalheight"),f&&a(this).height(f)}),!1;case"refresh":return!0;default:return!1}},a.fn.equalheightcolumns=function(b,c,d){var f,e="string"==typeof b?b:!1;if(e){if(b=a.extend({},a.equalheightcolumns.defaults,a(this).data("equalheightcolumns.options")),f=a.proxy(b.actions,this),"option"===e&&"undefined"==typeof d)return f(e,c);if(f(e,c,d)===!1)return a(this)}return b=a.extend({},a.equalheightcolumns.defaults,b),a(this).data("equalheightcolumns.options",b),a(this).each(function(){"undefined"==typeof a(this).data("equalheightcolumns.originalheight")&&a(this).data("equalheightcolumns.originalheight",a(this).height())}),f=a.proxy(b.resize,this),f(),a(this)}}(jquery);