UNPKG

custom-app

Version:

ITIMS��Ʒ�鿪��ר��React���,�Dz��ý��ּ�dhcc-app���������

27 lines (23 loc) 560 B
import utils from "./utils.js"; function getRegion(node) { var offset; var w; var h; if (!utils.isWindow(node) && node.nodeType !== 9) { offset = utils.offset(node); w = utils.outerWidth(node); h = utils.outerHeight(node); } else { var win = utils.getWindow(node); offset = { left: utils.getWindowScrollLeft(win), top: utils.getWindowScrollTop(win) }; w = utils.viewportWidth(win); h = utils.viewportHeight(win); } offset.width = w; offset.height = h; return offset; } export default getRegion;