Section 1: The Basics
This is the first section. When you click the button above, the page will smooth-scroll down here.
Section 2: The Middle
Notice how the highlight effect doesn't trigger until the scrolling has completely stopped. This guarantees the user actually sees the flash of color, rather than it happening off-screen.
Section 3: The End
With older APIs, you'd have to guess the scroll duration with a setTimeout, which often fired too early on slow devices or too late on fast ones.