ScrollLocker

Lock and unlock page scrolling

Hindi dapat direktang i-install ang script na ito. Ito ay isang library para sa iba pang mga script na isasama sa meta directive. // @require https://update.greasyfork.org/scripts/589163/1889704/ScrollLocker.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

May akda
ryxel
Bersyon
1.2
Nilikha
2026-07-30
Na update
2026-07-31
Laki
2.03 KB
Lisensya
MIT

ScrollLocker Documentation

ScrollLocker is a lightweight utility script used to lock and restore page scrolling.


Usage

Once loaded into the page, call lock() and unlock() directly on the global scrollLocker object.

1. Lock Scrolling

Call this when opening a modal, overlay, or sidebar:

scrollLocker.lock();

2. Restore Scrolling

Call this when closing the modal or restoring normal page interaction:

scrollLocker.unlock();


Properties & State

  • scrollLocker.isLocked (Boolean): Indicates whether page scrolling is currently locked (true if locked, false otherwise).
  • Repeated Calls: Calling scrollLocker.lock() while already locked will not re-trigger or duplicate styles. Calling scrollLocker.unlock() when unlocked has no effect.