antimatter.js 911 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. });