// initialisering $('a[href*="mailto:"]').each(function(){$(this).attr("href", "mailto:info@vanrip.nl").html($(this).html() + "info@vanrip.nl");}); // alle mailto: vullen met juiste e-mail adres $('a[href*="tel:"]').each(function(){$(this).attr("href", "tel:06 - 512 67890").html($(this).html() + "06 - 512 67890");}); // alle tel: vullen met juiste telefoonnummer if (!mobile){ $(".menuItem:first").css({"padding-left":($(window).width() - $(".menu").outerWidth()) / 2 }); $(".menuItem:last").css({"padding-right":($(window).width() - $(".menu").outerWidth()) / 2 / 1.7}); } // gebruiker-interactie $(".fixedTop").mousemove(function(e){ $(".menuItem").each(function(){ if (e.pageX > $(this).offset().left && e.pageX < $(this).offset().left + $(this).outerWidth() && e.pageY > $(this).offset().top && e.pageY < $(this).offset().top + $(this).outerHeight()){ $(".menuItem").removeClass("hover"); $(this).addClass("hover"); $("body").css({"cursor":"pointer"}); return false; } else {$(this).removeClass("hover"); $("body").css({"cursor":"default"});} }); }); $(".menuItem").click(function(e){e.preventDefault(); $(".mobile").removeClass("open"); $(".menu").slideToggle(250);}); $(".fixedTop").mousedown(function(e){ $(".menuItem").each(function(){ if (e.pageX > $(this).offset().left && e.pageX < $(this).offset().left + $(this).outerWidth() && e.pageY > $(this).offset().top && e.pageY < $(this).offset().top + $(this).outerHeight()){ //if ($(this).text() == $(".menuItem.selected").text()){$("html, body").stop().animate({"scrollTop":0}, 2000, "easeOutQuart"); return false;}; if ($(this).text() == "home"){location.href = "/";} if ($(this).text() == "Kerst 2017"){location.href = "/Kerst/";} if ($(this).text() == "evenementen"){location.href = "/evenementen/";} if ($(this).text() == "catering"){location.href = "/catering/";} if ($(this).text() == "verhuur"){location.href = "/verhuur/";} if ($(this).text() == "tenten"){location.href = "/tenten/";} if ($(this).text() == "foodtrailer"){location.href = "/foodtrailer/";} if ($(this).text() == "contact"){gotoContact(); return false;} if (mobile){$(".mobile").removeClass("open"); $(".menu").slideUp(250);} $(".menuItem").removeClass("selected"); $(this).addClass("selected"); return false; } }); }); $(".mobile").click(function(){$(this).toggleClass("open"); $(".menu").slideToggle(250);}); $(".callMe").click(function(){ if ($(".callBackName").val() == false){$(".callBackName").focus().css({"background-color": "#FF0000"}).stop().animate({"background-color": "#FFFFFF"}, 750); // niets ingevuld } else if ($(".callBackPhone").val() == false){$(".callBackPhone").focus().css({"background-color": "#FF0000"}).stop().animate({"background-color": "#FFFFFF"}, 750); // niets ingevuld } else if ($(".callBackQuestion").val() == false){$(".callBackQuestion").focus().css({"background-color": "#FF0000"}).stop().animate({"background-color": "#FFFFFF"}, 750); // niets ingevuld } else { var dataString = "subj=callMeBack&callBackName=" + $(".callBackName").val() + "&callBackPhone=" + $(".callBackPhone").val() + "&callBackQuestion=" + $(".callBackQuestion").val(); $.ajax({ type: "POST", url: "inc/PHP/mailHandler.php", data: dataString, success: function(){$(".callMeBack input, .callMeBack textarea").val(""); $(".callBackName").focus();} }); } }); $(".contactUs").click(function(){gotoContact();}); // functies function setMenu(){ } function gotoContact(){ toY = $(".contact.block").offset().top; if ($(".contact.block").outerHeight() < $(window).height()){toY = $(document).height() - $(window).height();} $("html, body").stop().animate({"scrollTop":toY}, 2000, "easeOutQuart"); } // Google Analytics (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga("create", "UA-90645370-1", "auto"); ga("send", "pageview");