fevangelou
12/12/2012 - 10:34 PM

Equal column heights with Mootools

Equal column heights with Mootools

window.addEvent('domready', function(){

  // Equal heights for all elements with "commonClassForEachBlock" class
	if($$('.commonClassForEachBlock')){
		var blocks = $$('.commonClassForEachBlock');
		var maxHeight = 0;
		blocks.each(function(item){
			maxHeight = Math.max(maxHeight, parseInt(item.getStyle('height')));
		});
		blocks.setStyle('height', maxHeight);
	}

});