UNPKG

@lagrange/animator

Version:

This library helps making parallax animations on scroll. It is built with performance in mind, as it doesn't need to relayout or paint to operate.

11 lines (9 loc) 248 B
/** * @param {Element} context * @param {Scrollbar} scrollbar */ export default function getContextScrollTop(context) { let ctx = context; if (context.tagName === 'HTML') ctx = document.scrollingElement || context; return ctx.scrollTop; }