Desktop App Productivity ★ 4,085 stars on GitHub

body-scroll-lock

Easily freeze background scrolling when pop-ups or menus open without breaking scrolling inside the open window on mobile and desktop browsers.

Visit Official Site

Guide and Overview

What it does in plain English

When you open a pop-up window, menu, or side panel on a website, the background page often moves around annoyingly under your fingertips. This handy tool freezes that background page completely, even on tricky mobile touchscreens. Best of all, it keeps your pop-up window or menu scrolling smoothly so visitors never get stuck.

Who it’s for

  • Frontend web developers building responsive websites with modal windows.
  • Mobile web designers striving for native-feeling app interactions on iOS and Android.
  • Creators building custom navigation menus, image galleries, and sliding drawers.

Key features

  • Freezes background scrolling without disabling movement inside your target pop-up window.
  • Works seamlessly across mobile and tablet devices, including tricky iOS touchscreens.
  • Compatible with plain JavaScript as well as popular tools like React, Angular, and Vue.
  • Reserves scrollbar width automatically to prevent annoying layout jumps or flickering.
  • Supports nested elements so multiple overlapping windows behave correctly.

How to install (Download)

You can include this package in your project using a package manager or visit the official site to learn more:

Pros and Cons

  • Pros: Lightweight, handles iOS momentum scrolling correctly, works across all major modern browsers.
  • Cons: Requires a small amount of code setup in your project scripts.

Optional commercial services unrelated to the open-source developer. Clicking an #ad link helps fund HubHum at no extra cost to you.

  • ★ Top Recommended — Systeme.io: Free-forever all-in-one platform to build landing pages, newsletters, and automated workflows with zero monthly fees — Activate Systeme.io → (#ad)
  • AdGuard: Block intrusive ads, tracking scripts, and phishing domains system-wide across all browsers and desktop apps — AdGuard (#ad)
  • InterServer: Launch and host self-hosted web apps 24/7 on managed Linux cloud VPS servers starting at $3/month — InterServer (#ad)

Official Source & Credits: Official Source / Credits

Affiliate transparency (#ad): Some links on this page are affiliate links. If you choose to activate a service through them, we may earn a commission at no extra cost to you.

Your Saved Favorites

Your favorite apps are saved right here in this browser.


Sign in with one click to link your GitHub profile and sync favorites.