Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Фикcированная шапка при скролле
$("#header").removeClass("default");
$(window).scroll(function(){
if ($(this).scrollTop() > 20) {
$("#header").addClass("default").fadeIn('fast');
} else {
$("#header").removeClass("default").fadeIn('fast');
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment