Update snippet descriptions
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user