🔐Body scroll locking that just works with everything
npm install @grawl-ru/tua-body-scroll-lock> inspired by body-scroll-lock
English | 简体中文
tua-body-scroll-lock enables body scroll locking for everything.``bash`
$ npm i -S tua-body-scroll-lockOR
$ yarn add tua-body-scroll-lock
)
* unpkg
* jsdelivr`html
`* Minified UMD(
tua-bsl.umd.min.js)
* unpkg
* jsdelivr`html
`Usage
$3
`js
import { lock, unlock } from 'tua-body-scroll-lock'lock()
unlock()
`$3
In some scenarios, when scrolling is prohibited, some elements still need to scroll, at this point, pass the targetElement.`js
import { lock, unlock } from 'tua-body-scroll-lock'const targetElement = document.querySelector('#someElementId')
lock(targetElement)
unlock(targetElement)
`> The
targetElement` is not required on the PC and Android.Thanks goes to these wonderful people (emoji key):
evinma 💻 📖 🚇 🌍 | StEve Young 💻 📖 🚇 🌍 | li2go 💻 🐛 | songyan,Wang 💻 🐛 | Даниил Пронин 🐛 |
This project follows the all-contributors specification. Contributions of any kind welcome!