Skip to content

Instantly share code, notes, and snippets.

@amandoabreu
Created February 6, 2018 13:21
Show Gist options
  • Save amandoabreu/8917990d28881cddd5010244f366ed98 to your computer and use it in GitHub Desktop.
Save amandoabreu/8917990d28881cddd5010244f366ed98 to your computer and use it in GitHub Desktop.
yes
$(window).scroll(function() {
if ($(this).scrollTop() > 0){
$('body').addClass("header-detached");
} else {
$('body').removeClass("header-detached");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment