Skip to content

Instantly share code, notes, and snippets.

@aarongarciah
Created July 14, 2016 06:30
Show Gist options
  • Save aarongarciah/a115d377d8be362af7c00e45d423c031 to your computer and use it in GitHub Desktop.
Save aarongarciah/a115d377d8be362af7c00e45d423c031 to your computer and use it in GitHub Desktop.
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