Skip to content

Instantly share code, notes, and snippets.

@rodrigobertin
Created October 4, 2017 02:13
Show Gist options
  • Save rodrigobertin/fce34838f2fcbd1e2b53ae54b36ed25d to your computer and use it in GitHub Desktop.
Save rodrigobertin/fce34838f2fcbd1e2b53ae54b36ed25d to your computer and use it in GitHub Desktop.
Fix Header
$(window).scroll(function(){
if ($(window).scrollTop() >= 300) {
$('nav').addClass('fixed-header');
}
else {
$('nav').removeClass('fixed-header');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment