shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
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
- $elm*-HTMLElement
The element to check
Return
- -Boolean
If the element is visible or not
Example
import { isVisible } from '@blackbyte/sugar/is'
if (isVisible(myCoolHTMLElement) {
// i'm visible
}Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space