1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = getScrollbarSize;
|
7 |
|
8 |
|
9 |
|
10 | function getScrollbarSize() {
|
11 | var scrollDiv = document.createElement('div');
|
12 | scrollDiv.style.width = '99px';
|
13 | scrollDiv.style.height = '99px';
|
14 | scrollDiv.style.position = 'absolute';
|
15 | scrollDiv.style.top = '-9999px';
|
16 | scrollDiv.style.overflow = 'scroll';
|
17 | document.body.appendChild(scrollDiv);
|
18 | var scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
19 | document.body.removeChild(scrollDiv);
|
20 | return scrollbarSize;
|
21 | } |
\ | No newline at end of file |