antimatter.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. var isTouch = window.DocumentTouch && document instanceof DocumentTouch;
  2. function scrollHeader() {
  3. // Has scrolled class on header
  4. var zvalue = $(document).scrollTop();
  5. if ( zvalue > 75 )
  6. $("#header").addClass("scrolled");
  7. else
  8. $("#header").removeClass("scrolled");
  9. }
  10. jQuery(document).ready(function($){
  11. // paralax
  12. // $('.parallax-window').parallax({imageSrc: '{/pages/02._programmes/10361_web_01.jpg}'});
  13. // ON SCROLL EVENTS
  14. if (!isTouch){
  15. $(document).scroll(function() {
  16. scrollHeader();
  17. });
  18. };
  19. // TOUCH SCROLL
  20. $(document).on({
  21. 'touchmove': function(e) {
  22. scrollHeader(); // Replace this with your code.
  23. }
  24. });
  25. //Smooth scroll to top
  26. $('#toTop').click(function(){
  27. $("html, body").animate({ scrollTop: 0 }, 500);
  28. return false;
  29. });
  30. // Responsive Menu
  31. // * Grab data attributes from twig with JQuery
  32. // */
  33. // $(() => {
  34. //
  35. // // Select elements by their data attribute
  36. // const $personneElements = $('[data-personne-id]');
  37. //
  38. // // Map over each element and extract the data value
  39. // const $personneIds =
  40. // $.map($personneElements, item => $(item).data('personneId'));
  41. //
  42. // // You'll now have array containing string values
  43. // console.log($personneIds); // eg: ["1", "2", "3"]
  44. // });
  45. // {% set script %}
  46. // // ton js
  47. // var mavariable = {{ twigvar }};
  48. // {% endset %}
  49. // {% do assets.addInlineJs(script) %}
  50. //
  51. // // POPIN Biographies
  52. // var id = $('#biographie').data('id');
  53. // if id > 0{
  54. // $(".bouton").click(function(){
  55. // $("#modal .message").html(#biographie);
  56. // $("#modal").addClass("open");
  57. // // $("#body").addClass("grey");
  58. // });
  59. // }
  60. // $(".bouton").click(function(){
  61. // $("#modal .message").html();
  62. // $("#modal").addClass("open");
  63. // // $("#body").addClass("grey");
  64. // });
  65. //
  66. // $("#modal .mask, #modal a.close").click(function(){
  67. // $("#modal").removeClass("open");
  68. // return false;
  69. // });
  70. });