iphone hide menu on bouncing fixed
This commit is contained in:
@@ -65,11 +65,13 @@
|
|||||||
})
|
})
|
||||||
//header
|
//header
|
||||||
var prevScrollPos = window.pageYOffset;
|
var prevScrollPos = window.pageYOffset;
|
||||||
|
|
||||||
window.onscroll = function() {
|
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.add("header-hidden");
|
||||||
document.getElementById("header").classList.remove("header-visible");
|
document.getElementById("header").classList.remove("header-visible");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user