Im trying to make a footer fully showing in the bottom once I scroll.
It is working on desktop, but not in mobile, can someone help me with?
Tkx
CSS---
footer{
position:fixed;
bottom:0;
height: 10vh;
width: 100vw;
transition: bottom 0.2s ease-in-out;
}
JS---
var prevScrollpos = window.pageYOffset;
window.onscroll = function() {
var currentScrollPos = window.pageYOffset;
if (prevScrollpos > currentScrollPos) {
document.getElementById("footer").style.bottom = "0";
} else {
document.getElementById("footer").style.bottom = "-5vh";
}
prevScrollpos = currentScrollPos;
}