closestNotVisibleElement

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

Go up the dom three to find the first element that is not visible. Not visible mean that has either an opacity to 0, a visibility to hidden or a display to none

Params

  1. $elm*-HTMLElement

    The element to start on

Return

  1. -HTMLElement | undefined

    The element found or undefined

Example

import { closestNotVisibleElement } from '@blackbyte/sugar/dom'
const closestElm =  closestNotVisibleElement($elm);
if (closestElm) {
  // we have found en element that is not visible
}

Todo

  • testsnormal