Search
How to Make a Scroll-Triggered Animation With Basic JavaScript
25.1.2022
A little bit of animation on a site can add some flair, impress users, and get their attention. You could have them run, no matter where they are on the page, immediately when the page loads. But what if your …
How to Make a Scroll-Triggered Animation With Basic JavaScript originally...
Fire SVG animations (SMIL) when the SVG is visible
7.9.2021
When requirements read “when visible” your brain should go straight to IntersectionObserver. That’s exactly what Zach is doing here to kick off an animation when it scrolls into view.
Except this animation is an SVG SMIL animation: an <animate>…
The post Fire...
Links on Performance
25.5.2021
Making GitHub’s new homepage fast and performant — Tobias Ahlin describes how the scrolling effects are done more performantly thanks to IntersectionObserver and the fact that it avoids the use of methods that trigger reflows, like getBoundingClientRect. Also,
…
The post Links...
Table of Contents with IntersectionObserver
11.3.2021
If you have a table of contents on a long-scrolling page, thanks to, say, position: fixed; or position: sticky;, the IntersectionObserver API in JavaScript is the perfect companion to highlight items in the table of contents when corresponding content …
The post Table of Contents with...
How to Play and Pause CSS Animations with CSS Custom Properties
21.1.2021
Let’s have a look CSS @keyframes animations, and specifically about how you can pause and otherwise control them. There is a CSS property specifically for it, that can be controlled with JavaScript, but there is plenty of nuance to get …
The post How to Play and Pause CSS Animations with...
Parsing Markdown into an Automated Table of Contents
13.11.2020
A table of contents is a list of links that allows you to quickly jump to specific sections of content on the same page. It benefits long-form content because it shows the user a handy overview of what content there is with a convenient way to get there.
This tutorial will show you how to parse...
Collective #605
14.5.2020
Modern CSS Solutions * IntersectionObserver Visualizer * Blush * Reef * Behind the Source * The Deno Handbook
Collective #605 was written by Pedro Botelho and published on Codrops
Sticky Table of Contents with Scrolling Active States
30.1.2020
Say you have a two-column layout: a main column with content. Say it has a lot of content, with sections that requires scrolling. And let's toss in a sidebar column that is largely empty, such that you can safely put a position: sticky; table of contents over there for all that content in the main...
An Explanation of How the Intersection Observer Watches
24.9.2019
There have been several excellent articles exploring how to use this API, including choices from authors such as Phil Hawksworth, Preethi, and Mateusz Rybczonek, just to name a few. But I’m aiming to do something a bit different here. I had an opportunity earlier in the year to present the VueJS...
A Few Functional Uses for Intersection Observer to Know When an Element is in View
8.5.2019
You might not know this, but JavaScript has stealthily accumulated quite a number of observers in recent times, and Intersection Observer is a part of that arsenal. Observers are objects that spot something in real-time — like birdwatchers going to their favorite place to sit and wait for the birds...
Native Lazy Loading
9.4.2019
IntersectionObserver has made lazy loading a lot easier and more efficient than it used to be, but to do it really right you still gotta remove the src and such, which is cumbersome. It's definitely not as easy as:
<img src="celebration.jpg" loading="lazy" alt="..." />
Addy Osmani says...
Scroll-Linked Animations
29.3.2019
You scroll down to a certain point, now you want to style things in a certain way. A header becomes fixed. An animation triggers. A table of contents appears. To do anything based on scroll position, JavaScript is required right now. You watch the scroll position via a DOM event and alter...