MCPcopy
hub / github.com/electerious/basicScroll / getScrollTop

Function getScrollTop

src/scripts/main.js:54–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52 * @returns {Number} scrollTop
53 */
54const getScrollTop = function() {
55
56 // Use scrollTop because it's faster than getBoundingClientRect()
57 return (document.scrollingElement || document.documentElement).scrollTop
58
59}
60
61/**
62 * Returns the height of the viewport.

Callers 3

relativeToAbsoluteValueFunction · 0.85
getPropsFunction · 0.85
loopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected