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

184
Views
How does requestAnimationFrame transform translate optimize for stuff out of browser viewport

I have some code when attached to a wrapper div, creates inserts some divs inside the wrapper div and that runs an animation loop for a second, moving child divs around.

I have a list of divs, on each div I attach this code and move the child divs around.

So if I layout these list of divs on top of each other with no styling they all become visible inside viewport, and there is some lag while moving animation of the child divs.

But if I layout these list of divs in a display flex, and a vertical scrollbar appears, only one item is visible in the viewport, there is no lag, child divs move smoothly.

I was wondering since there is no lag with display flex, as I present, I don't need to worry about only attaching items as they become visible, like as if lazy loading images.

And maybe get to the bottom of this, why is there lag on the first scenario?

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!