Skip to content

Instantly share code, notes, and snippets.

@th0mk
Last active January 13, 2016 20:09
Show Gist options
  • Save th0mk/75d060cc71830d727c44 to your computer and use it in GitHub Desktop.
Save th0mk/75d060cc71830d727c44 to your computer and use it in GitHub Desktop.
Script that changes adds and removes a class when you scroll below 200 (this can be changed)
$(window).scroll(function() {
if ($(document).scrollTop() > 200) {
$('someID').addClass('someClass');
} else {
$('someID').removeClass('someClass');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment