Skip to content

Instantly share code, notes, and snippets.

@Takaya213
Last active December 17, 2015 19:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Takaya213/5662331 to your computer and use it in GitHub Desktop.
Save Takaya213/5662331 to your computer and use it in GitHub Desktop.
Fixed the header/nav to the top of the page in a slightly different style via a class.
function scrolled_menu() {
if ($(window).scrollTop() > $('header').height()) {
$('header').addClass('fixed_type');
$('html').addClass('fixed_type_html');
} else {
$('header').removeClass('fixed_type');
$('html').removeClass('fixed_type_html');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment