DEV Community

Cover image for A neat DIY solution to animating on scroll (for any framework)

A neat DIY solution to animating on scroll (for any framework)

Ben Holmes on April 09, 2019

Update 4.10.19 A recent comment below blew my mind name dropping the Intersection Observer API. This was essentially built for exactly what this a...
Collapse
 
tbroyer profile image
Thomas Broyer

I think nowadays you'd better use IntersectionObserver for that: developer.mozilla.org/en-US/docs/W...

Collapse
 
bholmesdev profile image
Ben Holmes • Edited

Woah, this looks amazing! Admittedly there's no IE support but still, this looks like a much more performant way of checking scroll position. Thanks for the link!

Update: Added a note to the beginning of this post

Collapse
 
rohovdmytro profile image
Rohov Dmytro

[the repo]
Oops! Check the markdown.

In general I don't like custom scrolling but in this case it's actually neat!

Collapse
 
bholmesdev profile image
Ben Holmes

See, this is why you should never edit markdown on mobile 😆 Thanks for the catch. And that's so great to hear! Had a lot of fun with it.

Collapse
 
sauloco profile image
Saulo Vargas • Edited

Maybe I read it too fast, but is there a demo link?
Sorry I just saw the gsg.surge.sh link, I thought it was a non related side project you was advertising here hehe