shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
isInViewport
Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.is
Check if the passed HTMLElement is in the viewport or not
Params
- $elm*-HTMLElement
The element to check if it is in viewport or not
Return
- -Boolean
If the element is in the viewport or not
Example
import { isInViewport } from '@blackbyte/sugar/is'
if (isInViewport(myCoolHTMLElement) {
// i'm in the viewport
}Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space