this is javascript validation using the window.onscroll event
in the HTML source at the top:
window.onscroll = function () { if (!docked && (menu.offsetTop - scrollTop() < 0)) { menu.style.top = 0; menu.style.position = 'fixed'; menu.className = 'docked'; docked = true; } else if (docked && scrollTop() <= init) { menu.style.position = 'absolute'; menu.style.top = init + 'px'; menu.className = menu.className.replace('docked', ''); docked = false; } };
Mikem source share