Skip to content

Instantly share code, notes, and snippets.

View richarddewit's full-sized avatar
🗿
〰️〰️〰️〰️

Kerani richarddewit

🗿
〰️〰️〰️〰️
View GitHub Profile
var $window = $(window);
var $header = $('.sticky-header');
var scrolling = false;
var previousTop = 0;
var currentTop = 0;
var scrollDelta = 10;
var scrollOffset = 150;
$header.once('init-autohide-header', function() {
$window.on('scroll', function(){
// Adds 'unloading' class to `html` tag when navigating away from the page
//
// Make sure downloads open in another page with target="_blank"
// "beforeunload" is fired any time a link is clicked.
// If the link points to a file to download, the user won't be actually
// leaving the page, but beforeunload will still have fired.
(function () {
var unload = {};
unload.init = function () {