faim
Version:
Element Plus & Element UI isomorphic UI component library, more than Element.
18 lines (16 loc) • 463 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _default = element => {
const {
top,
right,
bottom,
left
} = element.getBoundingClientRect();
const yInView = top >= 0 && top <= window.innerHeight && bottom >= 0 && bottom <= window.innerHeight;
const xInView = left >= 0 && left <= window.innerWidth && right >= 0 && right <= window.innerWidth;
return yInView && xInView;
};
module.exports = _default;