1.3.10 • Published 3 years ago
prevent-scrolling v1.3.10
prevent-scrolling
Prevent scrolling while optionally allowing scrolling on specified elements.
Features
- Prevents scrolling via keyboard
- Maintains scrolling position
- Scrollbar will not disappear
- Can specify elements to still allow scrolling within
- Elements without scrolling disabled do not allow scroll events to overflow out to parent elements
Install
You can install via npm or yarn.
npm
npm install --save prevent-scrolling
yarn
yarn add prevent-scrolling
Usage
Importing
You can import using ES6 imports.
import { PreventScrolling, ReEnableScrolling } from 'prevent-scrolling';
Preventing Scrolling
PreventScrolling();
Preventing Scrolling but keep scrolling available on one element
const myScrollableElement = document.querySelector('.MyScrollableElement');
PreventScrolling(myScrollableElement);
Preventing Scrolling but keep scrolling available on multiple elements
const myScrollableElements = [].slice.call(document.querySelectorAll('.MyScrollableElement'));
PreventScrolling(myScrollableElements);
Re-enabling Scrolling
ReEnableScrolling();
1.3.10
3 years ago
1.3.9
3 years ago
1.3.7
3 years ago
1.3.8
3 years ago
1.3.6
4 years ago
1.3.5
4 years ago
1.3.4
4 years ago
1.3.3
4 years ago
1.3.2
5 years ago
0.0.1
5 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.2
6 years ago
1.2.1
7 years ago
1.2.0
7 years ago
1.1.4
7 years ago
1.1.3
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago