Skip to content
Advertisement

Scroll and let content stick while animating

I’m wondering how to achieve the following scroll animation, Where the STRATEGY and CREATIVE copy dock to the top and then animate while the user scroll, and when the animation is done, the page continue to scroll.

Please see page example here: https://www.mrsandmr.com/

See image here

What is this called in theory.

Thanks

Advertisement

Answer

I recently did some research on this as well, mainly inspired by the impressive web design on Apple product pages, like this one.

Here is a nice article I’ve found on Medium, which explains how to achieve such scrolling animations: How to jazz up your website like Apple with JavaScript

The result is available on the demo page here.

As summarized in the TL;DR section:

To sum it all up, the mechanism of how it works is really just:
1. A scrolling container
2. position: sticky;elements
3. JavaScript that converts scroll position of the scrolling container to styles for sticky elements
4. (Sometimes) CSS transition property

Animation logic for strategy/creative on “Mrs&Mr”

I would break it down to the following animation phases:

  1. translateX from the outside (relative to scroll position) until the 2 elements reach the center of the viewport
  2. Now rotate until 180° again relative to scroll position
  3. Again, translate but out of the viewport
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement