Webflow sync, pageviews & more.
NEW

How can I set up a snappy/sticky scroll slider for portraits on my website using Webflow?

TL;DR
  • Create a section with a scroll-wrapper div set to flex (row) and sticky positioning, sized to 100vw × number of slides.
  • Add 100vw × 100vh portrait slides inside the wrapper, align them with scroll snap settings via custom CSS, and enable smooth scrolling and optional page scroll interactions for added polish.

To create a snappy or sticky scroll slider for portraits in Webflow, you’ll use horizontal scroll interaction with scroll snap behavior and sticky positioning. Here's how to build it:

1. Prepare Your Section and Wrapper

  • Add a Section to your page and give it a class like "scroll-section".
  • Inside the section, add a Div Block for the scroll container (e.g., "scroll-wrapper"). This will hold all the portrait slides.

2. Style the Scroll Wrapper

  • Set Overflow: Hidden for the section to prevent content spilling.
  • Set the scroll-wrapper to:
  • Display: Flex
  • Flex Direction: Row
  • Width: 100vw × number of slides (e.g., 500vw for 5 slides)
  • Position: Sticky
  • Top: 0
  • Add a combo class to give the wrapper a fixed height (e.g., 100vh).

3. Add Portrait Slides

  • Inside the scroll-wrapper, add multiple Div Blocks (e.g., "portrait-slide").
  • Style each slide to:
  • Width: 100vw
  • Height: 100vh
  • Scroll Snap Align: Start
  • Use Background Image or Image Elements for the portraits.
  • Optional: Use Flexbox (center/center) to align contents inside each slide.

4. Enable Scroll Snap Behavior

  • On the scroll-wrapper (not the slides), set:
  • Overflow-X: Scroll
  • Scroll Direction: Horizontal
  • Scroll Snap Type: X mandatory (set this using custom CSS or embed style tag inside Webflow)
    • Example: scroll-wrapper → Custom Attribute:
    • Name: style
    • Value: scroll-snap-type: x mandatory; overflow-y: hidden;

5. Smooth Scrolling (Optional)

  • Enable smooth scrolling to make the snap behavior feel slick.
  • Add a custom embed inside the Webflow page <style> and target your scroll container:
  • Example:
    • scroll-wrapper { scroll-behavior: smooth; }
  • Paste this into a Custom Code embed or Page Settings > Inside .

6. Add Interaction (Optional for Sticky Feel)

  • Use Webflow’s Page Scroll interactions if you want to simulate sticky movement or animate elements as you scroll.
  • Example: animate the portrait’s scale or opacity as each slide enters the viewport.

Summary

To create a snappy/sticky scroll slider, build a horizontally scrolling container using flexbox, enable scroll-snap via custom CSS, and use 100vw slides for each portrait. Add optional page scroll interactions for more polish and animation.

Rate this answer

Other Webflow Questions