Advertisement
OrangePulp

Changing color header script when scroll

Feb 4th, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.   jQuery(window).on("scroll touchmove", function() {
  3.     if (jQuery(document).scrollTop() >= jQuery(".gc-remove-class").position().top) {
  4.       jQuery('#header-main').removeClass('header-white');
  5.     };
  6.     if (jQuery(document).scrollTop() >= jQuery(".gc-add-class").position().top) {
  7.       jQuery('#header-main').addClass('header-white');
  8.     };
  9.   });
  10. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement