antimatter.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. $(".bouton").click(function(){
  32. $("#modal .message").html();
  33. $("#modal").addClass("open");
  34. // $("#body").addClass("grey");
  35. });
  36. $("#modal .mask, #modal a.close").click(function(){
  37. $("#modal").removeClass("open");
  38. return false;
  39. });
  40. });