style.js 489 B

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