https://github.com/experience-monks/scroll-locker
Lock and unlock scroll on elements or document. Note that disabling scroll on body/document will propagate to all contained elements.
https://github.com/experience-monks/scroll-locker
scroll scroll-lock
Last synced: 11 months ago
JSON representation
Lock and unlock scroll on elements or document. Note that disabling scroll on body/document will propagate to all contained elements.
- Host: GitHub
- URL: https://github.com/experience-monks/scroll-locker
- Owner: Experience-Monks
- Created: 2017-06-26T20:02:41.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-26T20:03:15.000Z (almost 9 years ago)
- Last Synced: 2025-05-14T18:12:53.717Z (about 1 year ago)
- Topics: scroll, scroll-lock
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Lock and unlock scroll on elements or document.
Note that disabling scroll on body/document will propagate to all contained elements.
## Syntax
```javascript
scrollLocker(element [, disableKeyboardArrowsFlag]);
```
## API
* ```lock``` - disable elemen't scroll
* ```unlock``` - enable elemen't scroll
## Example
```javascript
import scrollLock from 'scroll-locker';
const scroll = scrollLock(container);
scroll.lock();
...
scroll.unlock();
```
## Install
```sh
npm install scroll-locker --save
```
## Test
```sh
npm t
```
## License
MIT, see [LICENSE.md](http://github.com/Jam3/scroll-locker/blob/master/LICENSE) for details.