1.0.5 • Published 3 years ago

get-scrollbar-width v1.0.5

Weekly downloads
2,013
License
MIT
Repository
github
Last release
3 years ago

get-scrollbar-width

Utility function to determine the scrollbar width of the current browser, returns zero if running server-side

I find this utility function particularly useful when creating a modal that blocks scrolling to determine how much padding is needed to prevent nasty jank from scrollbar removal.

var getScrollbarWidth = require('get-scrollbar-width');

var currentBrowserScrollbarWidth = getScrollbarWidth();

console.log(currentBrowserScrollbarWidth); // value depends on browser, 15 pixels is common

NPM

1.0.5

3 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago