Created
July 14, 2016 06:30
-
-
Save aarongarciah/a115d377d8be362af7c00e45d423c031 to your computer and use it in GitHub Desktop.
scrolling-debounce.js (via https://codyhouse.co/gem/auto-hiding-navigation/)
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
var scrolling = false; | |
$(window).on('scroll', function(){ | |
if( !scrolling ) { | |
scrolling = true; | |
(!window.requestAnimationFrame) | |
? setTimeout(autoHideHeader, 250) | |
: requestAnimationFrame(autoHideHeader); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment