var db = ""; function blockhoogte(){ if($(window).width() > 748){ $('div.block-container a.block').css('height', 'auto'); var highestBox = 0; $('div.block-container a.block').each(function(){ if($(this).height() > highestBox) highestBox = $(this).height(); }); $('div.block-container a.block').height(highestBox); }else{ $('div.block-container a.block').css('height', 'auto'); } } $( document ).ready(function() { $('div.customradio input[type=radio][name=accomodaties]').change(function() { var categorie = this.value; $('div.accomodatie_container div.block_animate').slideUp('fast').animate({ opacity: 0 },{ queue: false, duration: '600' }); $('#load_blocks').animate({ opacity: 1 },{ queue: false, duration: '100' }); setTimeout(function(){ $.ajax({ type : "POST", dataType : "json", url : "/ajax/accommodaties.php", data: {categorie: categorie, db:db}, success: function(response){ if(response.success == true){ var append = response.nav; $('div.accomodatie_container div.block-container div.block_animate').html(append); $('div.block_animate').slideDown('fast').animate({ opacity: 1 },{ queue: false, duration: '600' }); $('#load_blocks').animate({ opacity: 0 },{ queue: false, duration: '100' }); blockhoogte(); }else { //geen succes } } }); }, 600); }); $(window).resize(function() { blockhoogte(); }); });