I signed up a few minutes ago to ask my question to you dear community.
I have already tried to get ahead with similar questions, unfortunately without success.
Javascript is not my forte
I am detecting with php if it is a Mobile Device to show them a mobile navigationbar like this. The navigation bar is positioned at the bottom (and hides my Copyright Text).
if(isMobileDevice()){
require __DIR__. '/mobile-navbar.php';
}
my mobile-navbar.php looks so
<div class="uver-mobile-navbar" id="mobile-navbar">
<a href="#uver" class="active">uver</a>
<a href="#uver">uver</a>
<a href="#uver">uver</a>
<a href="#uver">uver</a>
<a href="#uver">uver</a>
</div>
and my mobile-navbar.js looks so
document.onscroll = function() {
if (window.innerHeight + window.scrollY > document.body.clientHeight) {
document.getElementById('mobile-navbar').style.display='none';
}else{
document.getElementById('mobile-navbar').style.display='block';
}
}
The problem is that as soon as I scroll, the div disappears. When I scroll up it doesn't appear anymore.
I thank you in advance for your support.
Best Regards Ridvan