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

124
Views
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
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!