diff --git a/docs/index.html b/docs/index.html index 734b92754..b98e50408 100644 --- a/docs/index.html +++ b/docs/index.html @@ -596,6 +596,7 @@ Omit the second argument to determine if the element is entirely visible, or spe it is partially visible.
const elementIsVisibleInViewport = (el, partiallyVisible = false) => {
const { top, left, bottom, right } = el.getBoundingClientRect();
+ const { innerHeight, innerWidth } = window;
return partiallyVisible
? ((top > 0 && top < innerHeight) || (bottom > 0 && bottom < innerHeight)) &&
((left > 0 && left < innerWidth) || (right > 0 && right < innerWidth))