Download Fore_End/cpcn2/node_modules/element-ui/lib/utils/scrollbar-width.js from zxy0307/JavaWeb: direct link, hf CLI and curl.
- Browser
- Download file 990 Bytes
-
https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/element-ui/lib/utils/scrollbar-width.js
- Command line
-
hf download hf://zxy0307/JavaWeb/Fore_End/cpcn2/node_modules/element-ui/lib/utils/scrollbar-width.js
-
curl -L -o scrollbar-width.js https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/element-ui/lib/utils/scrollbar-width.js
990 Bytes
| ; | |
| exports.__esModule = true; | |
| exports.default = function () { | |
| if (_vue2.default.prototype.$isServer) return 0; | |
| if (scrollBarWidth !== undefined) return scrollBarWidth; | |
| var outer = document.createElement('div'); | |
| outer.className = 'el-scrollbar__wrap'; | |
| outer.style.visibility = 'hidden'; | |
| outer.style.width = '100px'; | |
| outer.style.position = 'absolute'; | |
| outer.style.top = '-9999px'; | |
| document.body.appendChild(outer); | |
| var widthNoScroll = outer.offsetWidth; | |
| outer.style.overflow = 'scroll'; | |
| var inner = document.createElement('div'); | |
| inner.style.width = '100%'; | |
| outer.appendChild(inner); | |
| var widthWithScroll = inner.offsetWidth; | |
| outer.parentNode.removeChild(outer); | |
| scrollBarWidth = widthNoScroll - widthWithScroll; | |
| return scrollBarWidth; | |
| }; | |
| var _vue = require('vue'); | |
| var _vue2 = _interopRequireDefault(_vue); | |
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
| var scrollBarWidth = void 0; | |
| ; |