Skip to content

Instantly share code, notes, and snippets.

@taniarascia
Last active August 29, 2015 14:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save taniarascia/6d544f622a7c9f046df6 to your computer and use it in GitHub Desktop.
Navigation bar under header stick to top on scroll with jQuery
$(window).scroll(function() {
if ($(this).scrollTop() > 200) {
$('div').addClass('stickyheader');
} else {
$('div').removeClass('stickyheader');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment