var isTouch = window.DocumentTouch && document instanceof DocumentTouch; function scrollHeader() { // Has scrolled class on header var zvalue = $(document).scrollTop(); if ( zvalue > 75 ) $("#header").addClass("scrolled"); else $("#header").removeClass("scrolled"); } jQuery(document).ready(function($){ // paralax // $('.parallax-window').parallax({imageSrc: '{/pages/02._programmes/10361_web_01.jpg}'}); // ON SCROLL EVENTS if (!isTouch){ $(document).scroll(function() { scrollHeader(); }); }; // TOUCH SCROLL $(document).on({ 'touchmove': function(e) { scrollHeader(); // Replace this with your code. } }); //Smooth scroll to top $('#toTop').click(function(){ $("html, body").animate({ scrollTop: 0 }, 500); return false; }); // Responsive Menu // * Grab data attributes from twig with JQuery // */ // $(() => { // // // Select elements by their data attribute // const $personneElements = $('[data-personne-id]'); // // // Map over each element and extract the data value // const $personneIds = // $.map($personneElements, item => $(item).data('personneId')); // // // You'll now have array containing string values // console.log($personneIds); // eg: ["1", "2", "3"] // }); // {% set script %} // // ton js // var mavariable = {{ twigvar }}; // {% endset %} // {% do assets.addInlineJs(script) %} // // // POPIN Biographies // var id = $('#biographie').data('id'); // if id > 0{ // $(".bouton").click(function(){ // $("#modal .message").html(#biographie); // $("#modal").addClass("open"); // // $("#body").addClass("grey"); // }); // } // $(".bouton").click(function(){ // $("#modal .message").html(); // $("#modal").addClass("open"); // // $("#body").addClass("grey"); // }); // // $("#modal .mask, #modal a.close").click(function(){ // $("#modal").removeClass("open"); // return false; // }); });