UNPKG

ant-design-vue

Version:

An enterprise-class UI design language and Vue-based implementation

17 lines (16 loc) 480 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isInViewPort = isInViewPort; function isInViewPort(element) { const viewWidth = window.innerWidth || document.documentElement.clientWidth; const viewHeight = window.innerHeight || document.documentElement.clientHeight; const { top, right, bottom, left } = element.getBoundingClientRect(); return top >= 0 && left >= 0 && right <= viewWidth && bottom <= viewHeight; }