var navigPos = 30; var headerfix = function(first, rebase) { if (!$('#header').hasClass('headerfix') && rebase) { navigPos = $('#logo').offset().top; } if ($(window).scrollTop() > navigPos) { if (first) { $('#header').addClass('no_anim'); } else { $('#header').removeClass('no_anim'); } $('#header').addClass('headerfix'); } else { $('#header').removeClass('headerfix'); } } $(window).load(function() { headerfix(true, true); $(window).scroll(function() { headerfix(false, false); }); $(window).resize(function() { headerfix(false, true); }); }); /*--------------- Set Owl Carousel ---------------*/ function owlCarouselObjectsHome (target) { var arrowRight = target.find('.arrowRight').clone(); var arrowLeft = target.find('.arrowLeft').clone(); target.find('.owl-carousel').owlCarousel({ center:false, loop:true, navSpeed:600, autoWidth:false, touchDrag:true, autoplaySpeed:600, autoplayTimeout:6000, responsiveRefreshRate:50, autoplayHoverPause:true, navText:[arrowRight,arrowLeft], autoHeight:true, dots:false, margin:30, nav:true, responsive : { 0 : { autoplay:false, items:1 }, 580 : { items:2 }, 800 : { autoplay:true }, 1000 : { items:3 } } }); } $(window).load(function () { if ($(".owl-container-objects-home:not(.owl-carousel-unique)").length) { $(".owl-container-objects-home:not(.owl-carousel-unique)").each(function(){ if ($(this).is(':visible')) { owlCarouselObjectsHome($(this)); } }); } }); /*--------------- Set Owl Carousel Project on Home page ---------------*/ function owlCarouselProjectsHome (target) { target.children('.owl-carousel').owlCarousel({ center:true, loop:true, navSpeed:600, autoWidth:false, touchDrag:false, mouseDrag:false, autoplay:false, responsiveRefreshRate:50, autoplayHoverPause:false, items:1, autoHeight:true, dots:false, thumbs: true, thumbImage: false, thumbsPrerendered: true, thumbContainerClass: 'owl-thumbs', thumbItemClass: 'owl-thumb-item', margin:0, nav:false }); } $(window).load(function () { if ($(".body_main_index .owl-container-projects:not(.owl-carousel-unique)").length) { $(".body_main_index .owl-container-projects:not(.owl-carousel-unique)").each(function(){ if ($(this).is(':visible')) { owlCarouselProjectsHome($(this)); } }); } }); function owlCarouselProjectsHomePics (target) { target.children('.owl-carousel').owlCarousel({ center:true, loop:true, navSpeed:600, autoWidth:false, touchDrag:true, mouseDrag:true, autoplay:false, responsiveRefreshRate:50, autoplayHoverPause:false, items:1, autoHeight:false, margin:0, nav:false, responsive : { 0 : { dots:false }, 580 : { dots:true } } }); } $(window).load(function () { if ($(".body_main_index .owl-container-projects-home-pic:not(.owl-carousel-unique)").length) { $(".body_main_index .owl-container-projects-home-pic:not(.owl-carousel-unique)").each(function(){ if ($(this).is(':visible')) { owlCarouselProjectsHomePics($(this)); } }); } }); /*----- Page loaded -----*/ $(window).load(function () { /*----- Companies -----*/ if ($('#companies').length) { $('.companie_title').click(function(){ var company = $(this); var target = $('#infos_'+company.attr('id')); if (company.hasClass('selected')) { if (!target.find('.companie_subpart_infos.companie_infos_text').hasClass('selected')) { $('.companie_subpart').removeClass('selected'); target.find('.companie_subpart_infos.selected').stop(true, true).slideUp(function(){ $(this).removeClass('selected'); target.find('.companie_subpart_infos.companie_infos_text').slideDown(function(){ $(this).addClass('selected'); }); }); } } else { $('.companie_title').removeClass('selected'); company.addClass('selected'); $('.companie_infos.selected').stop(true, true).slideUp(function(){ $(this).removeClass('selected'); /*$('.companie_subpart_infos, .companie_subpart').removeClass('selected'); $('.companie_subpart_infos.companie_infos_text').addClass('selected');*/ target.slideDown(function(){ $(this).addClass('selected'); }); }); } }); $('.companie_subpart').click(function(){ var subpart = $(this); var target = $('#infos_'+subpart.attr('id')); if (subpart.hasClass('selected')) { $('.companie_title.selected').click(); } else { $('.companie_subpart').removeClass('selected'); subpart.addClass('selected'); target.siblings('.companie_subpart_infos.selected').stop(true, true).slideUp(function(){ $(this).removeClass('selected'); target.slideDown(function(){ $(this).addClass('selected'); }); }); } }); } /*----- Searchcriteria sliders -----*/ if ($('#searchcriteria_container').length) { var updatePriceValues = function(form) { form.find('.value_price').each(function(){ if (!$(this).hasClass('hidden')) { form.find('.price_inf').val($(this).find('#price_min_transformed').val()); form.find('.price_sup').val($(this).find('#price_max_transformed').val()); } }); } $('.check_deal').click(function(){ var deal = $(this).val(); var form = $(this).parents('.criterias_form'); form.find('.value_price').addClass('hidden'); form.find('.value_price_'+deal).removeClass('hidden'); displayBaseSliders(); updatePriceValues(form); }); $('.value_price .objects_filter_data').change(function(){ updatePriceValues($(this).parents('.criterias_form')); }); } /*--------------- Display form detail object ---------------*/ if ($('.button_detail_form').length) { $('.button_detail_form').click(function(){ if (!$('.detail_form').is(':visible')) { $(this).addClass('selected'); $('.detail_caracteristics').stop(true, true).slideUp(function(){ $('.detail_form').slideDown(function(){ $('.detail_form select:visible').selectmenu({ change: function( event, ui ) { $(this).trigger('change'); } }); }); }); } else { $(this).removeClass('selected'); $('.detail_form').stop(true, true).slideUp(function(){ $('.detail_caracteristics').slideDown(); }); } }); } /*--------------- Team click hover ---------------*/ if ($('.team_pic_box').length) { $('.team_pic_box').click(function(){ var team = $(this); if (team.hasClass('selected')) { team.removeClass('selected'); } else { team.addClass('selected'); } }); } /*--------------- Custom select ---------------*/ $('#header #lang_select').selectmenu({ change: function( event, ui ) { $(this).trigger('change'); }, appendTo: ".menu_top_module.lang" /*position: { my: 'left bottom', at: 'left top' },*/ }); $('#header #my_currency').selectmenu({ change: function( event, ui ) { $(this).trigger('change'); }, appendTo: ".menu_top_module.currency" /*position: { my: 'left bottom', at: 'left top' },*/ }); $('select:not(#results_display):not(#sorting_dropdown):visible, #inscription_table_newcriteria select').selectmenu({ change: function( event, ui ) { $(this).trigger('change'); } }); if ($('.navigation_link.selected').length) { menuSelectedDefault = $('.navigation_link.selected'); } $(window).resize(function() { $('select:not(#results_display):not(#sorting_dropdown), #inscription_table_newcriteria select, #results_top select').selectmenu("refresh"); }); });