Prevent Body Scroll on Click

When clicking something lock the scroll of <body> if it isn’t already locked (set to overflow: hidden;). This is useful for things like opening modals, a mobile nav, etc. to ensure the user doesn’t have two levels of scrolling occurring at once.

Update the classes of .nav-button and .nav-overlay in the snippet below with the class you use on the mobile menu button and an overlay div that covers the rest of the screen if needed when the mobile menu is open. If you don’t have a separate overlay div, you can also target the native one that is part of the native Nav element in Webflow, which has the class of .w-nav-overlay.

Industries

Creators

Have feedback or a question related to this item? Drop us some feedback!

Curated: 
2.11.22

Similar items

Advertise with No-Code Supply Co.

View item
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Framer Overrides

5.21.23

VRTL WRLD

5.19.23

Roof

5.19.23

HyperFramer

5.19.23

FlowBookings

$24/mo
5.19.23

Typeshare

5.16.23

Studio Duo

5.16.23

Enterprise Tech 30

5.16.23

Stage

5.16.23

Business Intelligence Group

5.15.23

Samuel Medvedowsky

5.12.23

LimLondon

5.12.23

Before & After Image Slider for Framer

5.11.23

Randoma11y

5.11.23

L.jardín

5.11.23

Lunour

5.11.23

Some Studio

5.11.23

A New Framework for Color in Webflow

5.10.23

Ultimate Guide To Airtable

$200
5.10.23

Wave

5.10.23

Super CSS Guide

$49
5.10.23

Pimpinella

5.10.23

Tabs to Dropdown

5.8.23

Swiper Tabs Slider

5.8.23

Nate Bruzdzinski

5.8.23

The Hive Membership

5.8.23

Antimetal

5.8.23

Juxtapose

5.8.23

Studio Kanda

5.8.23

Studio Office

5.8.23

No-Code Community

5.6.23

Nudl Journals

5.5.23

Finch

5.4.23

Validate HTML Inputs w/ Pattern Attribute

5.4.23

Nilus

5.3.23

Fixel Font

5.3.23

Databar

5.2.23

Before/After Splitter

4.30.23

ai.io

4.28.23

HARA

4.27.23

The Digital Panda

4.27.23

Standard Bots

4.27.23

STUDIO AI

4.27.23

Hydrosat

4.25.23

Monolita by Pretend Foundry

4.24.23

SoundCloud Stories

4.21.23

Mars Rejects

4.21.23

DVELE

4.20.23

Drop

4.20.23

CarbonOS | Patch

4.20.23

BRYCE – JONES

4.20.23

Last Prisoner Project

4.20.23
Load more

Bummer, no results

Try a different search/filter combo, or drop us some feedback if there is something missing you would love to see!

Reset filters

Subscribe for updates

Get updates on the latest curated resources and be the first to hear of new features.