pagina ' currentScrollPos) { header.style.top = "0"; } else { header.style.top = "-" + height; } prevScrollpos = currentScrollPos; } } $(document).ready(function () { $("a.scrollLink").click(function (event) { event.preventDefault(); $("html, body").animate({ scrollTop: $($(this).attr("href")).offset().top }, 500); }); document.body.className += (' site_' + window.location.host.split('.')[0]); //plaatjes klikken voor volledig venster // $("img").click(function () { var u = $(this).attr('src'); window.open(u, '_blank'); }).css({ "cursor": "pointer" }).attr("title","Klik voor orgineel"); }); document.addEventListener("DOMContentLoaded", function () { var lazyloadImages = document.querySelectorAll("img.lazy"); var lazyloadThrottleTimeout; function lazyload() { if (lazyloadThrottleTimeout) { clearTimeout(lazyloadThrottleTimeout); } lazyloadThrottleTimeout = setTimeout(function () { var scrollTop = window.pageYOffset; lazyloadImages.forEach(function (img) { if (img.offsetTop < (window.innerHeight + scrollTop)) { img.src = img.dataset.src; img.classList.remove('lazy'); } }); if (lazyloadImages.length == 0) { document.removeEventListener("scroll", lazyload); window.removeEventListener("resize", lazyload); window.removeEventListener("orientationChange", lazyload); } }, 20); } document.addEventListener("scroll", lazyload); window.addEventListener("resize", lazyload); window.addEventListener("orientationChange", lazyload); }); /*https://css-tricks.com/the-complete-guide-to-lazy-loading-images/*/ ////function activenav(id) { //// if (document.getElementById(id)) { //// var items = document.getElementById(id).getElementsByTagName("A"); //// var link = document.location.pathname; //// for (var x = 0; x < items.length; x++) { //// if (items[x].getAttribute("href") == link) { //// items[x].parentElement.setAttribute("class", "active"); //// } //// } //// } ////} ////activenav("sidebar"); ////activenav("topbar"); $(document).ready(function () { $("a.scrollLink").click(function (event) { event.preventDefault(); $("html, body").animate({ scrollTop: $($(this).attr("href")).offset().top - 200 }, 500); }); }); // verbergen zaken indien als popup geopend //if (getParameterByName("popup") != "") { // $(".klimaatmenu").hide(); // $(".footercontent").hide(); //} //// verbergen headerblock //if (getCookie("kiesklimaat_header") == "1") { // $("#header_block").hide(); //} //function hideheader() { // setCookie("kiesklimaat_header", "1"); // $("#header_block").hide(); //} //(function (d, s, id) { // var js, fjs = d.getElementsByTagName(s)[0]; // if (d.getElementById(id)) return; // js = d.createElement(s); js.id = id; // js.src = "//connect.facebook.net/nl_NL/sdk.js#xfbml=1&version=v2.9"; // fjs.parentNode.insertBefore(js, fjs); //}(document, 'script', 'facebook-jssdk')); function subscribe() { var naam = document.getElementById("subscribe_naam").value; var email = document.getElementById("subscribe_email").value; var param = { naam: naam, email: email } runprocedure("dbsp_subscribe", param, subscribesuccess); } function subscribesuccess(f) { $("#div_message").text(f.message); } function like(caseid) { var param = { caseid: caseid } var name = "dbsp_like @caseid, @userid"; runprocedure(name, param, likesuccess); } function likesuccess(f) { if (f.status == 1) { location.reload(); } else { alert(f.message); } } $("#timeline-Body").height("400px"); function shareonsocialmedia() { if (navigator.share) { navigator.share({ title: document.title, url: window.location.href }).then(() => console.log('Successful share')).catch(error => console.log('Error sharing:', error)); } } // text: "ik wil deze link graag met je delen", if (navigator.share) { $(".api").show(); } else { $(".api").hide(); } function loadsociallinks() { if (document.location.href.indexOf('defhandler.ashx') > -1 || document.location.href.indexOf('0x') > -1) { $("#share-buttons-footer").hide(); return; } var ref = encodeURIComponent(document.location.href); var title = document.title; if (title == "" || title == null) { title = $("H1").text(); } title = encodeURIComponent(title); var twitteraccount = $("meta[name='twitter:site']").attr("content"); twitteraccount = twitteraccount.replace('@', ''); var description = $("meta[name='twitter:description']").attr("content"); var url = "https://api.whatsapp.com/send?text=" + title + "%3A+" + ref; $("a.share-buttons.whatsapp").attr("href", url); url = "https://www.facebook.com/sharer/sharer.php?u=" + ref + "&text=" + title; $(".share-buttons-public .facebook").attr("href", url); url = "https://twitter.com/intent/tweet?url=" + ref + "&via=" + twitteraccount + "&text=" + title; $(".share-buttons-public .twitter").attr("href", url); url = "https://www.linkedin.com/shareArticle?mini=true&url=" + ref; $(".share-buttons-public .linkedin").attr("href", url); url = "mailto:?subject=" + title + "&body=" + encodeURIComponent(description) + " Zie de website: " + ref; $(".share-buttons-public .email").attr("href", url); } loadsociallinks(); var id = document.querySelector('meta[name~=userid][content]').content if (id != "0" && id != "") { if (document.getElementById("block_login")) document.getElementById("block_login").innerHTML = ""; } function sendcomment() { var txt = $("#comment").val(); var email = $("#comment_email").val(); if (txt != null && txt != "") { var param = { comment: txt, url: document.location.href, creatoremail: email }; storedata("comment", "0", param, sendcommentsuccess) } else { $("#comment").attr("placeholder", "vul hier uw vraag of suggestie in") } } function sendcommentsuccess(f) { if (f.status == 1) { $("#div_comment").html("Dank voor uw feedback"); } else { $("#div_comment").html("Er is iets niet goed gegaan: " + f.message); } } function addemail() { var txt = $("#email").val(); if (txt != null && txt != "") { var param = { email: txt }; runprocedure("dbsp_addemail", param, addemailsuccess) } } function addemailsuccess(f) { var id = "#div_addemail"; if (f.status == 1) { $(id).html("Het is gelukt!"); } else { $(id).html("Er is iets niet goed gegaan: " + f.message); } } function storedata(name, id, param, onsuccess) { var p = { name: name, id: id, param: param }; dojson("savedata", p, onsuccess); }