var isMobile = window.matchMedia("only screen and (max-width: 760px)"); isMobile = isMobile.matches; var currentWidth = "lg"; var timeout = null; var timeout2 = null; // JavaScript Document document.createElement("section"); // Check IE var ua = window.navigator.userAgent; var isIE = /MSIE|Trident/.test(ua); if (isIE) { console.log('IE'); } else { console.log('Not IE'); } //jQuery(window).on('load', function() { $(window).on('load', function () { jQuery('#preloader__status').fadeOut(); jQuery('#preloader').delay(350).fadeOut('slow'); jQuery('body').delay(350).css({'overflow':'visible'}); }); $(window).on('load', function() { equalSize(); sections(); //footerHeight(); }); $(window).resize(function() { equalSize(); footerHeight(); }); //Custom animation // $(window).scroll(function(){ // if($('#sizer:not(.resize)').length > 0) // { // var trigger_marge = 800; // var ttop = $(window).scrollTop() + $('header').outerHeight(); // var trigger_top = $('#sizer').offset().top; // if((ttop + trigger_marge) >= trigger_top) // $('#sizer').addClass("resize"); // } // }); $(document).ready(function() { //footerHeight(); // Menu $(".dropdown-menu>li>a.active").parents("li.dropdown").find("a.dropdown-toggle").addClass("active"); if($('.carousel').size()) { $('.carousel').carousel({ interval: 8000, pause: 'none' }); } // Mobile Menu $(window).scroll(function(){ let oppai = $(this).scrollTop(); if(oppai>190){ if(!$('body').hasClass('abrido')) $('#headerselect').addClass('arre'); } else { $('#headselect').removeClass('arre'); } }); $('.mobile_new_btn').on('click',function(e) { e.preventDefault(); $('.mobile_new_panel, body, .mobile_new_btn').toggleClass('abrido'); if($('#headselect').hasClass('arre')) { $('#headselect').removeClass('arre').addClass('arreno'); } else if($('#headselect').hasClass('arreno')) { $('#headselect').removeClass('arreno'); setTimeout(()=>{$('#headselect').addClass('arre')},800);} }); // Cover Image $.fn.coverImage = function(contain) { this.each(function() { var $this = $(this), src = $this.get(0).src, $wrapper = $this.parent(); if (contain) { $wrapper.css({ 'background': 'url(' + src + ') 50% 50%/contain no-repeat' }); } else { $wrapper.css({ 'background': 'url(' + src + ') 50% 50%/cover no-repeat' }); } $this.remove(); }); return this; }; jQuery('section.welkom .carousel-inner .item img').coverImage(); jQuery('section.werkzaamhedenhead .carousel .item .imgwrapper img').coverImage(); jQuery('.halfbgimg img.img-responsive').coverImage(); jQuery('.head img.img-responsive').coverImage(); jQuery('.subhead img.img-responsive').coverImage(); jQuery('.mensenhead img.img-responsive').coverImage(); jQuery('.newsitem .imgcontainer img').coverImage(); jQuery('.locimg img.img-responsive').coverImage(); jQuery('.imgcatwrap img.img-responsive').coverImage(); jQuery('.el__bg img.img-responsive').coverImage(); //Stick Menu var navPosition = $('header').offset().top; $(window).scroll(function(){ var navTop=$(window).scrollTop(); if(navPosition < navTop){ $('#headselect').addClass('fixed'); } else { $('#headselect').removeClass('fixed'); } }); // Goto Mouse $("a[href^='#']").click(function(e){ e.preventDefault(); var target = $( $(this).attr("href") ); if(target.length){ $("html,body").animate({ scrollTop:target.offset().top -300 },400); } }); $('.button_container').click(function() { $('.button_container').toggleClass('active'); $('.menu').toggleClass('open'); }); // Diensten Panels var $cont = document.querySelector('.cont'); var $elsArr = [].slice.call(document.querySelectorAll('.el')); var $closeBtnsArr = [].slice.call(document.querySelectorAll('.el__close-btn')); setTimeout(function() { if ($(".s--inactive")[0]){ $cont.classList.remove('s--inactive'); } }, 200); $elsArr.forEach(function($el) { $el.addEventListener('click', function() { if (this.classList.contains('s--active')) return; $cont.classList.add('s--el-active'); this.classList.add('s--active'); }); }); $closeBtnsArr.forEach(function($btn) { $btn.addEventListener('click', function(e) { e.stopPropagation(); $cont.classList.remove('s--el-active'); document.querySelector('.el.s--active').classList.remove('s--active'); }); }); // AOS AOS.init(); }); function getCurrentWidth() { if($(window).width()>=768) { currentWidth = "sm"; } if($(window).width()>=992) { currentWidth = "md"; } if($(window).width()>=1200) { currentWidth = "lg"; } if($(window).width()<768) { currentWidth = "xs"; } } function equalSize() { var cats = $(".equal"); $(cats).css({'height':'auto'}); var maxHeight = Array(); var indexes = Array(); getCurrentWidth(); if(cats.length) { $(cats).each(function(index, element) { var mobilecheck = $(this).data('equalmobile') != undefined ? $(this).data('equal') : 0; var equalid = $(this).data('equal') != undefined ? $(this).data('equal') : 0; var exclude = -1; if($(this).data('equalexclude')) { exclude = $(this).data('equalexclude').indexOf(currentWidth); } if(!mobilecheck && !isMobile && exclude == -1) { if(maxHeight[equalid] == undefined) { maxHeight[equalid] = 0; indexes[indexes.length] = equalid; } if($(this).innerHeight() > maxHeight[equalid]) { maxHeight[equalid] = $(this).innerHeight(); } } }); for(var i = 0;i 0) { $('#footer').css('padding-bottom',(paddingBottom - paddingTop)+'px'); } clearTimeout(timeout); timeout = null; },500); } } function getWinkelmand() { if(typeof(languagecode) == "undefined") { var languageadd_winkelmand = ''; } else { var languageadd_winkelmand = languagecode.length > 0 ? languagecode+'/' : ''; } $.ajax({ url:languageadd_winkelmand+"index2.php?moduleid=3&actie=winkelmandje&var1=ajax_Getmand", cache:false, complete: function(data,status) { $("div#winkelmand").html(data.responseText); } }); } function sections() { if(!$("body").data("ismobile")) { $window = $(window); $('section[data-type="background"]').each(function(){ // declare the variable to affect the defined data-type var $scroll = $(this); $(window).scroll(function() { // HTML5 proves useful for helping with creating JS functions! // also, negative value because we're scrolling upwards if($scroll.width() > 500) { var yPos = -($window.scrollTop() / $scroll.data('speed')); // background position var coords = '50% '+ yPos + 'px'; // move the background $scroll.css({ backgroundPosition: coords }); } }); // end window scroll }); // end section function } else { $(".well").removeClass("formwell").removeClass("well"); } } function scrollToId(el) { var pos = $(el.toString()).offset(); $('body, html').animate({ scrollTop: pos.top },{duration:1200,easing:"easeOutQuint"}); };