About 61 results
Open links in new tab
  1. javascript - Why is requestAnimationFrame better than setInterval or ...

    Aug 2, 2016 · Why should I use requestAnimationFrame rather than setTimeout or setInterval? This self-answered question is a documentation example.

  2. How to use requestAnimationFrame? - Stack Overflow

    Apr 9, 2011 · I'm new to animation, but I have recently created an animation using setTimeout. The FPS was too low, so I found a solution to use requestAnimationFrame, described in this link. So far, my …

  3. html - How to deal with the warning: violation requestanimationframe ...

    Dec 17, 2022 · How to deal with the warning: violation requestanimationframe took etc? Asked 3 years, 1 month ago Modified 2 years, 10 months ago Viewed 25k times

  4. Controlling fps with requestAnimationFrame? - Stack Overflow

    It seems like requestAnimationFrame is the de facto way to animate things now. It worked pretty well for me for the most part, but right now I'm trying to do some canvas animations and I was wonder...

  5. How do I test code that uses `requestAnimationFrame` in jest?

    I want to write a jest unit test for a module that uses requestAnimationFrame and cancelAnimationFrame. I tried overriding window.requestAnimationFrame with my own mock (as …

  6. How do I use ResizeObserver with requestAnimationFrame correctly

    Jan 18, 2024 · The issue here is the spec says that ResizeObserver callbacks happen after requestAnimationFrame callbacks. This means the order of operations in the example above is …

  7. event loop - setTimeout vs requestAnimationFrame - Stack Overflow

    Mar 18, 2022 · I made an example of 'setTimeout vs requestAnimationFrame' to find out how different they are. As you can see, the orange box arrives to the destination first. The green box jump some …

  8. How to use requestAnimationFrame inside a Class object

    Feb 16, 2018 · How to use requestAnimationFrame inside a Class object Asked 7 years, 11 months ago Modified 7 years, 11 months ago Viewed 4k times

  9. javascript - scroll events: requestAnimationFrame VS ...

    Jan 19, 2017 · requestAnimationFrame rAF gives you the point inside the frame life cycle right before the browser wants to calculate the new style and layout of the document. This is why it is perfect to …

  10. How to use requestAnimationFrame with Promise - Stack Overflow

    Dec 4, 2020 · I want to use requestAnimationFrame with Promise, so I can use it this way opacityToggle ("layername",0).then (i=>"do some stuff after animation ends") , but not sure how to d...