iphone hide menu on bouncing fixed

This commit is contained in:
2024-09-15 06:08:23 +02:00
parent 13ebf3d3a7
commit f4bd8739fd

View File

@@ -65,11 +65,13 @@
})
//header
var prevScrollPos = window.pageYOffset;
window.onscroll = function() {
var currentScrollPos = window.pageYOffset;
var currentScrollPos = window.pageYOffset;
const getHeaderHeight = document.getElementById('header')
const headerPosition = header.offsetTop + header.offsetHeight;
if (prevScrollPos < currentScrollPos) {
if (prevScrollPos < currentScrollPos && currentScrollPos > headerPosition ) {
document.getElementById("header").classList.add("header-hidden");
document.getElementById("header").classList.remove("header-visible");
}