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-scrollingyarn
yarn add prevent-scrollingUsage
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
4 years ago
1.3.8
4 years ago
1.3.6
5 years ago
1.3.5
5 years ago
1.3.4
5 years ago
1.3.3
5 years ago
1.3.2
6 years ago
0.0.1
6 years ago
1.3.1
7 years ago
1.3.0
7 years ago
1.2.2
7 years ago
1.2.1
8 years ago
1.2.0
8 years ago
1.1.4
8 years ago
1.1.3
8 years ago
1.1.2
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago