Last active
January 19, 2016 14:47
-
-
Save Korveld/2925a38d848c1535319f to your computer and use it in GitHub Desktop.
Sticky header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sticky header | |
$(window).scroll(function() { | |
if ( $(this).scrollTop() > 0 ) { | |
$('.top-block').addClass('fixed'); | |
} else if( $(this).scrollTop() == 0 ) { | |
$('.top-block').removeClass('fixed'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment