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

178
Vistas
Infinite scroll for mobile screens of my web application doesn't work

I use the following code to check if I can fetch the next page for my infinite scroll feature.

let bottomOfWindow = document.documentElement.scrollTop + window.innerHeight === document.documentElement.offsetHeight;

if (bottomOfWindow) {
    // some logic
}

This works well on desktop browsers but doesn't work on mobile browsers. On debugging, I noticed that the condition doesn't meet because of these values,

document.documentElement.scrollTop;

6580.72705078125

window.innerHeight

1851

document.documentElement.offsetHeight

8432

My questions,

  1. Why does this happen on mobile screens alone?
  2. If I change the condition to >= document.documentElement.offsetHeight * 0.90, will there be a scenario where even this condition will not satisfy?
  3. Is there a more elegant solution?
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