Created
June 8, 2018 02:11
-
-
Save bryanrsebastian/09d190d68c4810fe5b16d6bd20783954 to your computer and use it in GitHub Desktop.
Add class to header to design it and to become sticky
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
$( window ).scroll( function() { | |
if ( $(window).scrollTop() <= 50 ) { | |
$( 'header' ).removeClass( 'sticky' ); | |
} else { | |
$( 'header' ).addClass( 'sticky' ); | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment