Skip to the content

Sticky showcase

The features section of a product page, written as plain markup: one block per step, a picture or a video and a block of words, any number of steps.

Become a member to unlock the full effect today.

Join now

Already a member? Sign in

Documentation

  1. Copy to Webflow

    Add Geist and Geist Mono to your site's fonts (Site settings, Fonts, Google Fonts) before pasting: Webflow removes any font your site has not installed.

  2. Add custom CSS

    Two things belong to the page rather than to the component. No parent of the block may cut its overflow with overflow: hidden, which stops the media from pinning: use overflow-x: clip where a parent has to cut. And the block lays itself out: the Embed reads --sticky-showcase-share (the width of the media column), --sticky-showcase-inset-x and --sticky-showcase-inset-y (the air around the media), --sticky-showcase-step (the scroll a step takes), --sticky-showcase-top (the height of a fixed header), --sticky-showcase-stack and --sticky-showcase-ground (the height of the pinned media and the colour behind it on a phone). Set them in a rule of your own on the block itself: a value set on a parent is not inherited.
  3. Add custom JS

  4. Use it on your own elements

    Custom attributes
    Select the element on the canvas and open the Settings panel. Under Custom attributes, add a pair: the name on the left, the value on the right.
    Custom attributeWhat it does
    data-sticky-showcase Marks the block that holds the steps. It takes no value: leave the value field empty. That block becomes the grid of two columns, the words in one and the pinned media in the other, and it carries the settings below.
    data-sticky-showcase-step On each step, a direct child of the block. It takes no value. A step holds two blocks, its media and its words. Duplicate one to add a step, delete one to remove it. With fewer than two the block is left alone and the engine says so in the console. [ Required ]
    data-sticky-showcase-media On the box of a step that holds its picture or its video, and nothing else. It takes no value. Every media is pinned in the same place, and only the one of the step being read is seen. A step without it is skipped. [ Required ]
    data-sticky-showcase-rail On a direct child of the block: a block pinned over the media, for a counter. It takes no value. Without it nothing is pinned but the media. [ Optional ]
    data-sticky-showcase-current On a text inside the block: it receives the number of the step on the reading line, 02 for the second. It takes no value. [ Optional ]
    data-sticky-showcase-total On a text inside the block: it receives how many steps there are, 05 for five. It takes no value. [ Optional ]
    data-sticky-showcase-state Written by the engine on the block: live, or still under reduced motion. While the fins turn the block also carries data-sticky-showcase-turning, and the step on the reading line data-sticky-showcase-active. Never written by hand; the stylesheet reads them, and so can a rule of yours. [ Optional ]
    Settings
    Every setting is a custom attribute too, added the same way and on the same element. An attribute always wins over the defaults written in the code.
    AttributeDefaultWhat it is
    data-sticky-showcase-accent #ffab1a The colour of the edge of a fin, seen for the instant the fin is edge on. Options: any CSS colour. The amber of the preview by default; the colour of the page's ground to show no edge at all.
    data-sticky-showcase-slats 14 How many upright fins the media is cut into, from 2 to 48.
    data-sticky-showcase-wave 0.65 How far the fins turn one after another rather than together, from 0 to 1.
    data-sticky-showcase-hold 0.45 The share of the travel between two texts during which the media stays still, half at the start and half at the end, from 0 to 0.9.
    data-sticky-showcase-line 0.5 Where the reading line is, down the window, from 0.1 near the top to 0.9 near the foot: the text on it is the step whose media is shown. On a narrow screen the line is the middle of what the pinned media leaves, whatever this says.
    data-sticky-showcase-smooth 0.12 The time the turn takes to catch up with the scroll, in seconds, from 0 to 2.
    data-sticky-showcase-dim 0.55 The opacity of the texts that are not on the reading line, from 0 to 1.
    data-sticky-showcase-fit own What the frame of the media does with pictures of different ratios. Options: own, the frame takes the ratio of each picture in turn, as large as its column allows, and goes from one ratio to the next during the turn; cover, the frame fills its column and every picture covers it, cropped around its object-position. A narrow screen always covers.
    data-sticky-showcase-side right The column the pinned media is in. Options: right, the words on the left and the media on the right; left, the other way round, and the fins then turn from the side nearest the words all the same.

What it does

Sticky showcase is a scroll animation for Webflow and vanilla JavaScript, with no library. Also called change image on scroll sticky section, sticky scroll section or scrollytelling sticky image.

The features section of a product page, written as plain markup: one block per step, a picture or a video and a block of words, any number of steps. The words scroll down one column; the media of the step being read is pinned in the other. Between two steps the media is cut into upright fins that each carry the picture that leaves on one side and the picture that comes on the other, and they turn half a turn about their own middle, one after another, like the sun louvres of a facade. The turn is tied to the scroll: it advances, stops and runs back with the finger, and nothing is ever triggered. A fin seen edge on shows its edge in the accent, and loses its light as it turns away. The frame takes the ratio of each picture in turn and goes from one to the next while the fins turn, so portrait, landscape and square pictures mix without a crop or a letterbox. The words off the reading line fade back, by the distance they are from it. On a narrow screen the media is pinned edge to edge across the top and the words pass under it. The pin is CSS sticky positioning. Under reduced motion the pictures fade from one to the next; without JavaScript each step is its picture, then its words. No library. Pattern type sticky scroll section, scrollytelling, features section.

Updated

Questions

Mark a block data-sticky-showcase, each step inside it data-sticky-showcase-step, and in each step the box holding the picture data-sticky-showcase-media; the other block of the step is its text. The stylesheet pins every picture in the same place and the engine shows the one of the text being read. Duplicate a step in the Navigator to add one.

No. The pin is CSS sticky positioning on one grid cell, with no spacer and no scroll trigger, and the turn of the fins is read from the layout at every frame the scroll moves. No library is loaded, and Webflow.destroy() has nothing to take away.

Yes. With data-sticky-showcase-fit at own, the default, the frame takes the ratio of each picture in turn and goes from one to the next while the fins turn, so portrait and landscape mix with no crop; cover fills one frame instead. A step may hold a <video> with muted, playsinline and loop: the engine plays the one of the step being read.

Under 768 px there is one column: the picture is pinned edge to edge across the top of the window, --sticky-showcase-stack tall, 52% of the screen by default, and the texts are read below it and pass under it as they leave. The pictures always cover their frame there.

An ancestor with overflow: hidden, auto or scroll becomes the scroll container of the sticky picture, and a container that does not scroll has nowhere to pin. Use overflow-x: clip where a parent has to cut. Under a fixed header, give --sticky-showcase-top the height of that header.