PromoCursed/node_modules/rc-util/es/Dom/isVisible.js

27 lines
658 B
JavaScript
Raw Normal View History

2024-08-20 23:25:37 +04:00
export default (function (element) {
if (!element) {
return false;
}
if (element instanceof Element) {
if (element.offsetParent) {
return true;
}
if (element.getBBox) {
var _getBBox = element.getBBox(),
width = _getBBox.width,
height = _getBBox.height;
if (width || height) {
return true;
}
}
if (element.getBoundingClientRect) {
var _element$getBoundingC = element.getBoundingClientRect(),
_width = _element$getBoundingC.width,
_height = _element$getBoundingC.height;
if (_width || _height) {
return true;
}
}
}
return false;
});