Skip to content

CMS & Logic4 min read

How to Lock Page Scrolling in Webflow with Finsweet Scroll Lock

Learn how to lock page scrolling in Webflow with Finsweet Scroll Lock: click trigger, visibility, and target.

In this tutorial, Sandro, cofounder of the Gemeos Webflow agency, shows you how to prevent page scrolling with Finsweet Attributes Scroll Lock, handy for modals and mobile menus.

AttributeElementValue
fs-scrolllock-elementTrigger elementtrigger
fs-scrolllock-eventTrigger elementclick or visible
fs-scrolllock-lockTrigger elementtrue or false
fs-scrolllock-targetTrigger elementCSS selector for the scrollable element (default: body)

1. Add the script in the head

<script src="https://cdn.jsdelivr.net/npm/@finsweet/attributes-scrolllock@1/scrolllock.js" defer><!--</span-->script>

2. Set up the click trigger

On the button that opens your modal or menu, add:

  • fs-scrolllock-element="trigger"
  • fs-scrolllock-event="click"
  • fs-scrolllock-lock="true" (to lock scrolling)

On the close button, add the same attributes with fs-scrolllock-lock="false".

3. Set up the visibility trigger

To lock scrolling automatically when an element becomes visible, for example, a modal opened through a Webflow Interaction, use fs-scrolllock-event="visible" on the modal element itself. Finsweet detects when it appears and locks or unlocks scrolling automatically.

4. Target a specific container (optional)

By default, Scroll Lock locks scrolling on the entire body. To lock scrolling on a specific container, for example, a sidebar, add fs-scrolllock-target="#mon-conteneur".

Conclusion

Scroll Lock prevents background scrolling when overlays open. Use cases:

  • Modals and popups that open on the page
  • Full-screen mobile menu
  • Drawers and sidebars

Published on May 19, 2026

Sandro DA SILVA

Growth Marketer, Webflow expert, and jack-of-all-trades. Sandro handles commercial operations, ensures projects run smoothly, and addresses marketing-related issues (SEO, Tracking, Copywriting, etc).

You might be interested in these tutorials

Related tutorials

See all

You're going to working with us, guaranteed

Ready to launch your business?

get a quote

Let’s f*****G GO !!