Skip to the content

Image parallax

The parallax every site asks for, as one piece.

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

    The frame keeps the size you give it, a ratio, a height or the height of its picture, and cuts everything that leaves it: keep captions and shadows outside it, and give it no padding. A wrapper set to overflow: hidden above the picture, as most Webflow pages have, is no trouble: the engine sees it and times the picture on the scroll of the page instead of on its frame. On a marked picture the Embed sets height, max-height, margin-top, margin-bottom, object-fit and vertical-align with !important, since the class of nearly every image sets a height: those six are no longer yours on that image, so size and space the frame, not the picture, and frame the photograph with object-position. If a rule of yours still holds the picture shorter, or the file is too small for its frame, the console says so with the numbers.
  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-image-parallax Marks the box that holds a picture, or the image itself. Its value is the intensity, the share of the scroll the picture holds back: 0.2 for a picture that moves a fifth slower than the page, a negative number to send it the other way, 0 to hold it still. Left empty it takes the default, 0.15. It is the setting <code>intensity</code> written the short way, and it wins over <code>data-image-parallax-intensity</code>; the other settings go beside it, on the same element, and on an element marked <code>data-image-parallax-layer</code> the same way.
    data-image-parallax-layer On any other element, a title, a caption, a block of words: it moves by the same law, with no frame and nothing enlarged. Its value is its intensity; keep it small, 0.03 to 0.12, negative to move faster than the page. [ Optional ]
    data-image-parallax-media Inside a marked box that holds several pictures: marks the one that moves. It takes no value. Without it the first img, video or canvas of the box is taken. [ Optional ]
    data-image-parallax-state Written by the engine on what you marked: view when the browser drives the picture on a view timeline, root when it is timed on the scroll of the page, script when the script moves it, still under reduced motion or at intensity 0. Never written by hand. [ 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-image-parallax-intensity 0.15 The share of the scroll the picture holds back, from -1 to 1. At 0.2 the picture moves a fifth slower than the page, as if it stood behind it. Two pictures with the same number sit at the same depth, whatever their sizes.
    data-image-parallax-narrow 0.6 The share of the intensity kept on a screen narrower than 768px, from 0 to 1. A phone window is tall next to its pictures, so the same depth asks each one for much more room.
    data-image-parallax-limit 1.6 The most a picture may outgrow its frame, as a multiple of the frame's height, 1 and up. A small frame at a strong intensity would need a picture several times its own height: past the limit the travel is shortened instead.
    data-image-parallax-native true Whether the travel runs on the browser's own scroll timeline where there is one. Options: true, a CSS view timeline in Chrome, Edge and Safari 26, the script elsewhere; false, the script everywhere, for a page whose scroll is not the document's or to compare the two.

What it does

Image parallax is a scroll animation for Webflow and vanilla JavaScript, with no library. Also called image parallax on scroll, parallax scrolling effect or background image parallax section.

The parallax every site asks for, as one piece. Mark the box that holds a picture, or the picture itself, with data-image-parallax and a number: the share of the scroll the picture holds back. The picture then moves a little slower than the page inside its frame, as if it stood further away. The engine works out, for each frame, the room that travel needs from the height of the frame, the height of the window and the intensity, makes the picture exactly that much taller, and checks the result, so no edge ever shows whatever the speed of the scroll or the size of the frame. The file fills the taller box with object-fit, which uses the part of the photograph the frame was hiding before anything is enlarged, so nothing is stretched and nothing is blurred; when a file is too small for its frame and its travel the console says so, with the size it needs. The picture stays the real img of the page, with its alt, srcset, sizes and loading attributes. Where the browser has scroll driven animations (Chrome, Edge, Safari 26) the travel is a CSS view timeline on the compositor and no script runs while the page scrolls; elsewhere one scroll listener places every picture from numbers measured once. A second attribute, data-image-parallax-layer, moves any other element by the same law, for a title or a caption at its own depth. Under reduced motion nothing moves and nothing is enlarged. No library. Pattern type image parallax, scroll parallax, background parallax.

Updated

Questions

Select the Div Block that holds your image, or the Image itself, and add the custom attribute data-image-parallax with a number for its value, 0.2 to start with. The picture then moves a fifth slower than the page inside its frame. Nothing else is set: the engine works out the room the picture needs and makes it that much taller.

No. In Chrome, Edge and Safari 26 the travel is a CSS scroll driven animation, a view timeline on the frame, and no script runs while the page scrolls. In a browser without scroll timelines, Firefox today, one passive scroll listener places the pictures from numbers measured once. No library is loaded.

Because the picture was not made tall enough for the distance it travels, which depends on the height of the frame, the height of the window and the speed. Here that room is computed for each picture, intensity times the window plus the frame, written as a height on the img, then read back; if a rule of the page still holds the picture shorter, the travel is cut to match and the console says so.

Yes. Mark the section data-image-parallax, put the img inside it with position: absolute, top: 0, left: 0, width: 100% and height: 100%, and give the words after it position: relative. It stays a real img with its alt, srcset and loading, not a CSS background.

The value of the attribute is the speed: data-image-parallax="0.1" is subtle, 0.3 is deep, a negative number sends the picture the other way and 0 holds it still. Under 768px the intensity is multiplied by narrow, 0.6 by default, and limit, 1.6 by default, caps how far a small picture may outgrow its frame.