inViewport
Commons
stable
Returns true if a bounding box (IBox or DOMRect) is at least partially visible in the current viewport.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- elementrequisIBox | DOMRect
- A bounding box with top, right, bottom, left properties. Typically obtained via element.getBoundingClientRect().
API
Valeur de retour
La valeur retournée par cet util.
- true when any part of the box is within the viewport boundaries; false otherwise.
Usage
Exemples
Extraits de code prêts à coller.
Check element visibility on scroll