$( document ).ready(function() { //gestion padding pour cover ////recupère la hauteur du header //gestion sous nav pour les menus /*$('#menuPlat').width($('#menuPlat').width()); $('.containMenuPlat').height($('.containCoverPlat').height()); var offset = $('.containCoverPlat').offset(); nOffset=parseInt(offset.top)-navHeight;*/ /*$('#menuPlat').affix({ offset: { top: nOffset, } })*/ //gestion titre EldoraTV var h=0; $('.titreTV').each(function(){ var pHeight=$(this).height(); if(pHeight>h) {h=pHeight;} }); $('.titreTV').each(function(){ $(this).height(h); }); //gestion titre Recettes Mois var h=0; $('.blockRecetteMois h3').each(function(){ var pHeight=$(this).height(); if(pHeight>h) {h=pHeight;} }); $('.blockRecetteMois h3').each(function(){ $(this).height(h); }); //gestion recette elem /*var h=0; $('.viewRecette').each(function(){ $(this).find('.titreRecette').each(function(){ var pHeight=$(this).height(); if(pHeight>h) {h=pHeight;} }); }); $('.viewRecette').each(function(){ $(this).find('.titreRecette').each(function(){ $(this).height(h); }); });*/ $('.displayRecette').each(function(){ $(this).click(function(){ console.log('displayRecette'); var parElem=$(this).parents('.blockRecetteCategorie'); var elem=parElem.next('.viewRecette'); elem.toggle(100, function(){ var h=0; elem.find('.titreRecette').each(function(){ var pHeight=$(this).height(); if(pHeight>h) {h=pHeight;} }); elem.find('.titreRecette').each(function(){ $(this).height(h); }); var hi=0; elem.find('.imgHolder').each(function(){ var pHeight=$(this).height(); if(pHeight>hi) {hi=pHeight;} }); elem.find('.imgHolder').each(function(){ $(this).height(hi); }); }); return false; }); }); $('.blockRecetteCategorie').each(function(){ $(this).click(function(){ var elem=$(this).next('.viewRecette'); elem.toggle(100, function(){ var h=0; elem.find('.titreRecette').each(function(){ var pHeight=$(this).height(); if(pHeight>h) {h=pHeight;} }); elem.find('.titreRecette').each(function(){ $(this).height(h); }); var hi=0; elem.find('.imgHolder').each(function(){ var pHeight=$(this).height(); if(pHeight>hi) {hi=pHeight;} }); elem.find('.imgHolder').each(function(){ $(this).height(hi); }); }); return false; }); }); $('#cduok').change(function() { if($('#cduok').prop('checked')===true) { $('.badgebtn').removeClass('disable'); $('.badgebtn').removeClass('greybtn'); } else if( $('#cduok').prop('checked')===false) { $('.badgebtn').addClass('disable'); $('.badgebtn').addClass('greybtn'); } }); $( "#eventdate" ).datepicker({ dateFormat: 'dd/mm/yy', minDate: 3,/*13 !!! */ beforeShowDay: $.datepicker.noWeekends, showOn: "button", buttonImage: "https://app.eldora.ch/common_file/img/calendar-ico-eldora.jpg", buttonImageOnly: true });//fin datepicker $('#treatform').submit(function(){ var error=0; $('.eventBat').parents('.col-md-4').css('border','0px solid #ffffff'); $('.accdepartement').parents('.col-md-4').css('border','0px solid #ffffff'); $('.service').parents('.col-md-4').css('border','0px solid #ffffff'); $('.CostCenter').parents('.col-md-4').css('border','2px solid #ffffff'); var choose=$(".eventBat option:selected").val(); if(choose=='--') { $('.eventBat').parents('.col-md-4').css('border','2px solid #ff0000'); var error=1; } var choose=$(".accdepartement option:selected").val(); if(choose=='--') { $('.accdepartement').parents('.col-md-4').css('border','2px solid #ff0000'); var error=1; } var choose=$(".service option:selected").val(); if(choose=='--') { $('.service').parents('.col-md-4').css('border','2px solid #ff0000'); var error=1; } var choose=$(".CostCenter option:selected").val(); if(choose=='--') { $('.CostCenter').parents('.col-md-4').css('border','2px solid #ff0000'); var error=1; } $('#eventdate').removeAttr("disabled"); if(error==1) {event.preventDefault();} }); $('.centrefrais').select2(); var navHeight=$('#navigation').height(); console.log(navHeight) var navHeight=$('#navigation1550').height(); console.log(navHeight) var navHeight=$('#navigation1150').height(); console.log(navHeight) $('.fullHeaderHome').css('padding-top', navHeight); navHeight=parseInt(navHeight)+50; $('.topPage').css('padding-top', navHeight); $(".containMenuPlat").on('affixed.bs.affix', function(){ $('.containCoverPlat').addClass('col-md-offset-2'); }); $(".containMenuPlat").on('affixed-top.bs.affix', function(){ $('.containCoverPlat').removeClass('col-md-offset-2'); }); $(".containMenuPlat").width($(".containMenuPlat").width()); var CPoffset=$('.containCoverPlat').offset(); $('.containMenuPlat').attr('data-offset-top',CPoffset.top); }); appear({ init: function init(){ console.log('dom is ready'); reappear:true; }, elements: function elements(){ // work with all elements with the class "track" return document.getElementsByClassName('track'); }, appear: function appear(el){ console.log('visible', el); $(el).addClass('topt'); }, disappear: function disappear(el){ console.log('unvisible', el); $(el).removeClass('topt'); }, bounds: -400, reappear: true });