$(document).ready(function() { // Fix the a/img problem $(".content a > img").parent().addClass('linkedImage'); // Equal height columns var maxHeight = 0; $('.resize').each(function(i) { if($(this).height() > maxHeight) maxHeight = $(this).height(); }); $('.resize').height(maxHeight); // Spacer $('#spacerLink').click(function(){ if($('#spacer').css('padding-top') == '130px') $('#spacer').animate({ paddingTop: '440px' }, 1000, function() { $(this).removeClass('close').addClass('open'); $('#spacerLink').html('Verklein headerbeeld'); }); else $('#spacer').animate({ paddingTop: '130px' }, 1000, function() { $(this).removeClass('open').addClass('close'); $('#spacerLink').html('Vergroot headerbeeld'); }); }); // Tabs $('#projectTabs > div > h4 > a').click(function(evt) { evt.preventDefault(); if($(this).parent().parent().hasClass('closed')) { $('#projectTabs > div.open > div').animate( { padding: '0', width: '0' }, 400, 'linear', function() { $(this).parent().removeClass('open').addClass('closed'); } ); $(this).parent().parent().removeClass('closed').addClass('open'); $(this).parent().next().css('width', 0).css('padding', 0); $(this).parent().next().animate( { width: '312px' }, 400, 'linear', function() {} ); } }); });