//jQuery (function($){ jQuery.fn.equalHeight = function() { console.log(this); return this.each(function(i, item){ console.log(item); var children = $(item).children(); var maxHeight = 50; for (var i = 0; i < children.lenght; i++) { if ( $(children[i].height() > maxHeight) ) { maxHeight = $(children[i]).height(); } } children.height(maxHeight); }); } }(jQuery)) $('.container1') .css('color', 'red') .hide() .equalHeight() .fadeIn();