isVisible

Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.is

Check if the passed HTMLElement is visible or not. Visible mean that it has not an opacity of 0, not a visibility of hidden and not a display of none and return !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length);

Params

  1. $elm*-HTMLElement

    The element to check

Return

  1. -Boolean

    If the element is visible or not

Example

import { isVisible } from '@blackbyte/sugar/is'
if (isVisible(myCoolHTMLElement) {
  // i'm visible
}

Todo

  • testsnormal