Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
Hide a <div> when scrolled to the bottom with javascript

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!