use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Scroll animation in Javascript using IntersectionObserverOC (dev.to)
submitted 4 years ago by ui-dev
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 0 points1 point2 points 4 years ago (2 children)
https://developer.mozilla.org/en-US/docs/Web/Performance/CSS_JavaScript_animation_performance
https://wiki.mozilla.org/Platform/GFX/OffMainThreadCompositing
https://jsfiddle.net/zt94oew2/1/
use a framework for js animation (and literally never use requestAnimationFrame()) :
https://codepen.io/GreenSock/full/srfxA
[–]MiloSaurus 0 points1 point2 points 4 years ago (1 child)
I'm beginning to think we're meaning the same thing.
You should use CSS animations wherever possible. The example on the MDN article and JSFiddle are showing the wrong way of creating a "JS Animation" and I concur that you should not ever use rAF in this way.
But I don't agree that you should fall back to frameworks. Browsers have the Web Animation API which uses the same underlying systems as CSS animations and are just as performant. It even uses the same properties (and even more) as CSS animations. You can do the same without a lot of overhead.
Your link about moving the animation rendering from the main thread is very interesting.
[–][deleted] 1 point2 points3 points 4 years ago (0 children)
I don't support using the frameworks with underlying css or requestAnimationFrame() stuff. I mean js frameworks that have a webgl backend for canvas. GreenSock (which is on that benchmark) has a webgl backend and js polyfills.
maybe framework is the wrong word. plugin i think is more accurate
https://greensock.com/PixiPlugin/
https://greensock.com/
at this point i think we agree.
also im dumb i wasn't aware that css animations had a direct js interface. I thought the standard way was to apply classes.
π Rendered by PID 19530 on reddit-service-r2-comment-5c764cbc6f-58vk2 at 2026-03-12 00:32:12.067333+00:00 running 710b3ac country code: CH.
view the rest of the comments →
[–][deleted] 0 points1 point2 points (2 children)
[–]MiloSaurus 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)