Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

248
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda