Files
wechatpay-enterprise-web/node_modules/vant/es/utils/dom/style.js
jefferyzhao b9bdc8598b first commit
2025-07-31 17:44:12 +08:00

9 lines
424 B
JavaScript

export function isHidden(el) {
var style = window.getComputedStyle(el);
var hidden = style.display === 'none'; // offsetParent returns null in the following situations:
// 1. The element or its parent element has the display property set to none.
// 2. The element has the position property set to fixed
var parentHidden = el.offsetParent === null && style.position !== 'fixed';
return hidden || parentHidden;
}