$(document).ready(function(){ function eqHeight(item) { var maxHeight = 0; $(item).each(function(){ $(this).css('height', 'auto'); if ($(this).outerHeight() > maxHeight) {maxHeight = $(this).outerHeight();} }); $(item).css('height', maxHeight); } if (window.innerWidth > 480) { resizeblocks(); } else { $('.multiplecontent-single').css('height', 'auto'); } $(window).on('load resize', function () { if (window.innerWidth > 480) { resizeblocks(); } else { $('.multiplecontent-single').css('height', 'auto'); } }); function resizeblocks() { setTimeout(eqHeight('.multiplecontent-single'), 200); } });