MCPcopy Create free account
hub / github.com/devforth/painterro / getScrollbarWidth

Function getScrollbarWidth

js/utils.js:131–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129}
130
131export function getScrollbarWidth() {
132 const outer = document.createElement("div");
133 outer.style.visibility = "hidden";
134 outer.style.width = "100px";
135 outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps
136 document.body.appendChild(outer);
137 const widthNoScroll = outer.offsetWidth;
138 outer.style.overflow = "scroll";
139 const inner = document.createElement("div");
140 inner.style.width = "100%";
141 outer.appendChild(inner);
142 const widthWithScroll = inner.offsetWidth;
143 outer.parentNode.removeChild(outer);
144 return widthNoScroll - widthWithScroll;
145}
146
147export function imgToDataURL(url, callback, failedCb) {
148 const xhr = new XMLHttpRequest();

Callers 1

showMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…