# all files / lib/utilities/ scrollBarUtilities.js

21.43% Statements 3/14
0% Branches 0/2
0% Functions 0/1
21.43% Lines 3/14

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    1×
    1×

    1×

     "use strict";
    var _scrollBarWidth;
    function scrollBarWidth() {
        if (_scrollBarWidth === undefined) {
            var scrollDiv = document.createElement('div');
            scrollDiv.style.setProperty('width', '100px');
            scrollDiv.style.setProperty('height', '100px');
            scrollDiv.style.setProperty('overflow', 'scroll');
            scrollDiv.style.setProperty('position', 'absolute');
            scrollDiv.style.setProperty('top', '-9999px');
            document.body.appendChild(scrollDiv);
            // Get the scrollbar width
            _scrollBarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
            // Delete the DIV
            document.body.removeChild(scrollDiv);
        }
        return _scrollBarWidth;
    }
    exports.scrollBarWidth = scrollBarWidth;

    //# sourceMappingURL=scrollBarUtilities.js.map