Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lock and unlock scroll on elements or document. Note that disabling scroll on body/document will propagate to all contained elements.

Syntax

scrollLocker(element [, disableKeyboardArrowsFlag]);

API

  • lock - disable elemen't scroll
  • unlock - enable elemen't scroll

Example

import scrollLock from 'scroll-locker';

const scroll = scrollLock(container);
scroll.lock();

...
scroll.unlock();

Install

npm install scroll-locker --save

Test

npm t

License

MIT, see LICENSE.md for details.

About

Lock and unlock scroll on elements or document. Note that disabling scroll on body/document will propagate to all contained elements.

Topics

Resources

Code of conduct

Contributing

Stars

2 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages