Update snippet descriptions

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-19 18:51:03 +03:00
parent f0fbe0c3e5
commit 5e8e6f51a3
36 changed files with 97 additions and 82 deletions

View File

@ -1,12 +1,11 @@
---
title: elementIsVisibleInViewport
tags: browser,advanced
tags: browser,intermediate
---
Returns `true` if the element specified is visible in the viewport, `false` otherwise.
Checks if the element specified is visible in the viewport.
- Use `Element.getBoundingClientRect()` and the `window.inner(Width|Height)` values
- to determine if a given element is visible in the viewport.
- Use `Element.getBoundingClientRect()` and the `window.inner(Width|Height)` values to determine if a given element is visible in the viewport.
- Omit the second argument to determine if the element is entirely visible, or specify `true` to determine if it is partially visible.
```js