code: function (el) {
          return isElement(el)
              && document.body.contains(el)
              && el.getBoundingClientRect().height > 0
              && el.getBoundingClientRect().width > 0
      }
docs: Determines if an HTML element is visible - Faster than CSS check