UNPKG

vue-hooks-plus

Version:
22 lines (21 loc) 802 B
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const getScrollTop = (el) => { if (el === document || el === document.documentElement || el === document.body) { return Math.max( window.pageYOffset, document.documentElement.scrollTop, document.body.scrollTop ); } return el.scrollTop; }; const getScrollHeight = (el) => { return el.scrollHeight || Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); }; const getClientHeight = (el) => { return el.clientHeight || Math.max(document.documentElement.clientHeight, document.body.clientHeight); }; exports.getClientHeight = getClientHeight; exports.getScrollHeight = getScrollHeight; exports.getScrollTop = getScrollTop;