MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / setValue

Function setValue

src/components/scrollbar/index.js:198–208  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

196 }
197
198 function setValue(val) {
199 if (!height || !width) resize(false);
200
201 //Make sure value is between 0 and 1
202 if (val < 0) val = 0;
203 else if (val > 1) val = 1;
204
205 scroll = val;
206 if (isVertical) $cursor.style.top = val * height + "px";
207 else $cursor.style.left = val * width + "px";
208 }
209
210 function destroy() {
211 window.removeEventListener("resize", resize);

Callers 1

resizeFunction · 0.70

Calls 1

resizeFunction · 0.85

Tested by

no test coverage detected