5 // Some innovative scrollbar measuring stuff
7 var scrollDiv = document.createElement('div');
8 scrollDiv.className = 'scrollbar-measure';
9 document.body.appendChild(scrollDiv);
11 // Get the scrollbar width
12 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
14 document.body.removeChild(scrollDiv);
16 return scrollbarWidth > 0;
19 module.exports = function scrollbarDetect() {
20 if (hasScrollBars !== undefined) return hasScrollBars;
22 return (hasScrollBars = detect());