MCPcopy Create free account
hub / github.com/Barrior/JParticles / offset

Function offset

src/utils/dom.ts:27–33  ·  view source on GitHub ↗
(elem: HTMLElement)

Source from the content-addressed store, hash-verified

25 * @param elem DOM 元素
26 */
27export function offset(elem: HTMLElement): { left: number; top: number } {
28 const bounding = elem.getBoundingClientRect()
29 return {
30 left: window.pageXOffset + bounding.left,
31 top: window.pageYOffset + bounding.top,
32 }
33}
34
35/**
36 * 不管是 MutationObserver 还是 DOMNodeRemoved,

Callers 3

dom.spec.tsFile · 0.90
handleClickMethod · 0.90
getEventElemOffsetMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected