$().ready(function() { if($(window).width() > 640) { $('.colclip').sameHeights(); var gt = $('#gauche').height(); var ct = $('#contenu').height(); if (ct > gt) { $('#gauche').css({'height': gt}); } else { $('contenu').css({'height': ct}); } } }); function jsToggle(idtf, selectedEffect){ //get effect type from //most effect types need no options passed by default var options = {}; //check if it's scale, transfer, or size - they need options explicitly set if(selectedEffect == 'scale'){ options = {percent: 0}; } else if(selectedEffect == 'size'){ options = { to: {width: 200,height: 60} }; } //run the effect $("#"+idtf).toggle(selectedEffect,options,1000); return false; }; /* Plugin to make variable height divs equal heights */ $.fn.sameHeights = function() { $(this).each(function(){ var tallest = 0; $(this).children().each(function(i){ if (tallest < $(this).height()) { tallest = $(this).height(); } }); $(this).children().css({'height': tallest}); }); return this; };