style.js 424 B

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