Const
Checks if an element is currently visible within the viewport.
Uses getBoundingClientRect() to determine if the element is within the viewport boundaries.
getBoundingClientRect()
Operation data with isInViewport boolean indicating visibility
isInViewport
// Check if element is in viewconst result = isElementInViewport({ selectedElement: $targetElement});// result.isInViewport = true or false Copy
// Check if element is in viewconst result = isElementInViewport({ selectedElement: $targetElement});// result.isInViewport = true or false
Checks if an element is currently visible within the viewport.
Uses
getBoundingClientRect()to determine if the element is within the viewport boundaries.