$(window).load(function() { /*--------------- Home news slide ---------------*/ if(document.getElementById('header_slide')){ var header_actu=0; var cible=0; var header_total=$('#header_slide > .header_picture').length; var slide_home=function(cible, auto){ if(auto && header_actu+1 < header_total){ cible=header_actu+1; }else if(auto){ cible=0; } if(cible!=header_actu){ $('#header_picture_'+header_actu).css({zIndex:header_total+1}); $('#header_picture_'+cible).css({zIndex:header_total}); $('#header_picture_'+header_actu).fadeOut(1200, function(){ $('#header_picture_'+cible).css({zIndex:header_total+2}); $(this).css({zIndex:1}).show(); }); header_actu=cible; } clearTimeout(time_home); time_home = window.setTimeout(function(){slide_home(false, true);}, 6000); } time_home = window.setTimeout(function(){slide_home(false, true);}, 6000); } /*--------------- Box Size Custom ---------------*/ if(document.getElementById('presentation_custom_container')){ var box_size = 0; $('#presentation_custom_container .box_content').each(function(){ if ($(this).height() > box_size) { box_size = $(this).height(); } }); $('#presentation_custom_container .box_content').css({height:box_size}); } });