File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ disable scroll
4
4
<a href =" https://www.npmjs.com/package/disable-scroll " target =" _blank " >![ ] ( https://badge.fury.io/js/disable-scroll.svg ) </a > <a href =" https://travis-ci.org/gilbarbara/disable-scroll " target =" _blank " >![ ] ( https://travis-ci.org/gilbarbara/disable-scroll.svg ) </a >
5
5
6
6
** Prevent page scrolling like a boss.**
7
- Support ` scrollbar, mousewheel, touchmove, keydown ` events.
7
+ Supports ` scrollbar, mousewheel, touchmove, keydown ` events.
8
8
9
9
## Install
10
10
@@ -21,13 +21,13 @@ disableScroll.on();
21
21
disableScroll .off ();
22
22
```
23
23
24
- ## Configuration
24
+ ## API
25
25
26
26
### .on([ element] , [ options] )
27
- Add the event listeners and scroll.
27
+ Disable page scrolling by adding event listeners and locking the scroll position .
28
28
29
29
- ` [element] ` - DOM Element. Defaults to ` document.body `
30
- - ` [options] ` - Change the initial options. Defaults to:
30
+ - ` [options] ` - Change the initial options. Defaults to:
31
31
32
32
``` javascript
33
33
{
@@ -39,4 +39,8 @@ Add the event listeners and scroll.
39
39
```
40
40
41
41
### .off()
42
- Remove the listeners.
42
+ Re-enable page scrolling and remove the listeners.
43
+
44
+ ---
45
+
46
+ Inspired by [ jquery-disablescroll] ( https://github.com/ultrapasty/jquery-disablescroll )
You can’t perform that action at this time.
0 commit comments