All Projects → gilbarbara → disable-scroll

gilbarbara / disable-scroll

Licence: MIT License
Prevent page scrolling

Programming Languages

typescript
32286 projects

Labels

Projects that are alternatives of or similar to disable-scroll

slider-manager
simple wrapper to create sliders focused on animations
Stars: ✭ 28 (-75.44%)
Mutual labels:  scroll
ng-mat-select-infinite-scroll
Infinite Scroll directive for angular material select component
Stars: ✭ 39 (-65.79%)
Mutual labels:  scroll
scrollparent.js
A function to get the scrolling parent of an html element.
Stars: ✭ 51 (-55.26%)
Mutual labels:  scroll
use-gesture
👇Bread n butter utility for component-tied mouse/touch gestures in React and Vanilla Javascript.
Stars: ✭ 6,624 (+5710.53%)
Mutual labels:  scroll
magic-scroll
Apple Magic Mouse scrolling effect for normal mouses
Stars: ✭ 43 (-62.28%)
Mutual labels:  scroll
ACarousel
A carousel view for SwiftUI | SwiftUI 旋转木马效果
Stars: ✭ 124 (+8.77%)
Mutual labels:  scroll
angular2-infinite-scroll
Infinite Scroll Directive For Angular (version 2 up to 2.3.1)
Stars: ✭ 16 (-85.96%)
Mutual labels:  scroll
linux-scroll-speed-fix
A Chrome app that fixes the slow scroll speed in Chrome for Linux.
Stars: ✭ 33 (-71.05%)
Mutual labels:  scroll
vue-next-level-scroll
Bring your scroll game to the next level!
Stars: ✭ 49 (-57.02%)
Mutual labels:  scroll
react-infinite-scroll-list
Manage infinite list with the IntersectionObserver API
Stars: ✭ 20 (-82.46%)
Mutual labels:  scroll
use-scroll-direction
A simple, performant, and cross-browser hook for detecting scroll direction in your next react app.
Stars: ✭ 24 (-78.95%)
Mutual labels:  scroll
react-bottom-scroll-listener
A simple listener component that invokes a callback when the webpage is scrolled to the bottom.
Stars: ✭ 129 (+13.16%)
Mutual labels:  scroll
ngx-scroll-to-first-invalid
Directive to scroll to first invalid form control inside an Angular form on submit
Stars: ✭ 27 (-76.32%)
Mutual labels:  scroll
SSCycleScrollView
轮播终结者,用swift完成,易用集成
Stars: ✭ 39 (-65.79%)
Mutual labels:  scroll
window-scroll-position
React hook for Window scroll position
Stars: ✭ 81 (-28.95%)
Mutual labels:  scroll
EasyScrollDots
Single page scroll JavaScript plugin that allows for vertical navigation of page sections
Stars: ✭ 38 (-66.67%)
Mutual labels:  scroll
dom-locky
🙈🙉🙊 - the best way to scope a scroll, or literally any other event.
Stars: ✭ 18 (-84.21%)
Mutual labels:  scroll
srraf
Monitor scrolling and resizing without event listeners.
Stars: ✭ 26 (-77.19%)
Mutual labels:  scroll
lovelace-plotly-graph-card
Highly customisable Lovelace card to display interactive graphs. Brings scrolling, zooming, and much more!
Stars: ✭ 38 (-66.67%)
Mutual labels:  scroll
volx-recyclerview-fast-scroll
An easy to use implementation for fast scroll recyclerview
Stars: ✭ 34 (-70.18%)
Mutual labels:  scroll

disable scroll

NPM version build status Maintainability Test Coverage

Prevent page scrolling like a boss.
Supports scroll, wheel, touchmove, keydown events.

Demo

Setup

npm

npm install --save disable-scroll

and import it

import disableScroll from 'disable-scroll';

Usage

disableScroll.on(); // prevent scrolling
...
disableScroll.off(); // re-enable scroll

If you need to support legacy browsers you need to include the scrollingelement polyfill.

API

.on(element?: Element, options?: Options)

Disable page scroll by adding event listeners and locking the scroll position.

Options defaults to:

{
    authorizedInInputs: [32, 37, 38, 39, 40],
    disableKeys: true,
    disableScroll: true,
    disableWheel: true,
    keyboardKeys: [32, 33, 34, 35, 36, 37, 38, 39, 40],
}

.off()

Re-enable page scrolling and remove the listeners.

Issues

If you find a bug, please file an issue on our issue tracker on GitHub.

License

MIT


Inspired by jquery-disablescroll

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].