Created
May 4, 2022 02:27
-
-
Save mikeott/1e0cc39a7e193b8850ef21cee9a3480d to your computer and use it in GitHub Desktop.
If scrolled past number of pixels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).scroll(function() { | |
if ($(document).scrollTop() > 100) { | |
$('.header').addClass('scrolled'); | |
} | |
else { | |
$('.header').removeClass('scrolled'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment