Skip to content

inViewport ​

Determines if an element is visible within the viewport.

Usage ​

ts
import { inViewport } from 'rattail'

const isVisible = inViewport(document.querySelector('div'))

Arguments ​

ArgTypeDefaults
elementHTMLElement

Return ​

Type
boolean