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

131
Vistas
How do I know (el.scrollHeight - el.scrollTop +1).toFixed(0) >= el.clientHeight.toFixed(0) its greater than by 1 than return true onScroll?

How do I know (target.scrollHeight - target.scrollTop +1).toFixed(0) >= target.clientHeight.toFixed(0) its greater than by only 1 than return true if its greater than 1 or any other value than it will return false.

I was trying this code...

const handleScroll = (event) => {
    const target = event.target;

    if ((target.scrollHeight - target.scrollTop).toFixed(0) === target.clientHeight.toFixed(0)) {

      let pageNo = page + 1;
      if (pageNo <= pageCount) {
        fetchSuppliers(data , pageNo);
        setPage(pageNo);
      }
    }
  };

This code is not working on some chrome cause in some big screen resolution the value is 201 === 200 so that time this code not working..**

so i have to try the greater than or equal condition but here has a fallback cause the left value will change on scroll like 800 >= 200 its giving true but i want when the value 201 or 202 >= 200 then it should return true otherwise return false

Help me on this regards Thank you all

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