As Mathias mentioned in the comments consider applying this to the root element (document.documentElement) instead of document.body. Note that this will prevent clicking links for half a second (the timeout used in the code). 60fps scrolling using pointer-events: none →
Tag Archives: scroll
60fps scrolling using
CSS Scroll Snap Points
Great to see this proposed (many people are using it nowadays, boosted by the iPhone 5s page). .gallery { scroll-snap-type: mandatory; scroll-snap-points-x: snapList(786px, 1643px, 2483px, 3264px, 4054px, 4402px); } Don’t like the fact that one needs to specify explicit values (be it in pixels, ems, or percentages), as not all children can be of the …
Scroll Animations
A little Pen I knocked together to demonstrate “CSS Animations triggered on scroll” to some of my students. The key part is the animated class which actually starts the animation: it is only added once the element is in view. Check out this Pen! Note that the event handler is not debounced as we need …