So I\'m putting a website together which will have a few css3 animations triggered on the scroll event. About halfway through writing the scrolling animations, I\'m noticing
I fixed this by changing the document.body.scrollTop and document.documentElement.scrollTop to > 1 instead of > 50 or > 25:
window.onscroll = function () {
// Change the scrollTop conditions here.
if (document.body.scrollTop > 1 || document.documentElement.scrollTop > 1) {
yourTopBarInnerElement.style.display = "none";
} else {
yourTopBarInnerElement.style.display = "block";
};
};
It works for me at least.