Skip to content

enables / disables html scroll without content jumping around. 184 bytes.

License

Notifications You must be signed in to change notification settings

henrygd/hide-show-scroll

Repository files navigation

hide-show-scroll npm File Size

https://henrygd.me/hide-show-scroll

This won't work if the scrollbar is on an element other than html. May add that option in the future.

Module Usage

$ npm install hide-show-scroll
import { hideScroll, showScroll } from 'hide-show-scroll'

// lock scroll / hide html scrollbar
hideScroll()

// allow scroll / show html scrollbar
showScroll()

Direct Script Usage

<script src="hide-show-scroll.min.js"></script>
// lock scroll / hide html scrollbar
hideShowScroll.hideScroll()

// allow scroll / show html scrollbar
hideShowScroll.showScroll()

License

MIT