ScrollLocker

Lock and unlock page scrolling

Цей скрипт не слід встановлювати безпосередньо. Це - бібліотека для інших скриптів для включення в мета директиву // @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.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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!)

Автор
ryxel
Версія
1.2
Створено
30.07.2026
Оновлено
31.07.2026
Size
2,0 кБ
Ліцензія
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.