function smartStickyNav() {
var lastScrollTop = 0;
window.addEventListener("scroll", function(){
var st = window.pageYOffset || document.documentElement.scrollTop;
if($(window).scrollTop() > $(".fixed-content").height()) {
$("#fsHeader .nav-main").addClass("fixed");
if (st > lastScrollTop){
console.log("scrolldown");
$("#fsHeader .nav-main").removeClass("show");
}
else {
$("#fsHeader .nav-main").addClass("show");
console.log("scrollup");
}
lastScrollTop = st;
}
else {
$("#fsHeader .nav-main").removeClass("fixed").removeClass("show");
}
}, false);
}
tai pei . red esi gn . fin al si te . com
Scroll down and you’ll notice the header disappear, and on scroll up it’ll show back in view. Now scroll back to the top of the page and do it again. You’ll see it do a little jump before it goes out of view. Looking at the dev tools, it gets the “show” class real fast before getting removed. The thing is, the console log accompanying the “show” isn’t being fired. What sort of glitch is this? Looking for consistent behavior.