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

Function getOffsetTopWithinContainer

src/pages/markdownPreview/index.js:65–75  ·  view source on GitHub ↗
(target, container)

Source from the content-addressed store, hash-verified

63}
64
65function getOffsetTopWithinContainer(target, container) {
66 let top = 0;
67 let element = target;
68
69 while (element && element !== container) {
70 top += element.offsetTop || 0;
71 element = element.offsetParent;
72 }
73
74 return top;
75}
76
77async function getMermaid() {
78 if (!mermaidModulePromise) {

Callers 1

scrollToHashFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected