Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbarbara committed Sep 8, 2015
1 parent b82e21a commit 2705cba
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ disable scroll
<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>

**Prevent page scrolling like a boss.**
Support `scrollbar, mousewheel, touchmove, keydown` events.
Supports `scrollbar, mousewheel, touchmove, keydown` events.

## Install

Expand All @@ -21,13 +21,13 @@ disableScroll.on();
disableScroll.off();
```

## Configuration
## API

### .on([element], [options])
Add the event listeners and scroll.
Disable page scrolling by adding event listeners and locking the scroll position.

- `[element]` - DOM Element. Defaults to `document.body`
- `[options]` - Change the initial options. Defaults to:
- `[options]` - Change the initial options. Defaults to:

```javascript
{
Expand All @@ -39,4 +39,8 @@ Add the event listeners and scroll.
```

### .off()
Remove the listeners.
Re-enable page scrolling and remove the listeners.

---

Inspired by [jquery-disablescroll](https://github.com/ultrapasty/jquery-disablescroll)

0 comments on commit 2705cba

Please sign in to comment.