isitthere
v1.0.3
Published
Simple function that takes in an element and returns % visible in viewport along with boolens for topVisible and bottomVisible.
Downloads
4
Maintainers
Readme
IsItThere?
Simple function that takes in an element and returns how much of it is visible in the viewport along with information about the top and bottom being visible
import isItThere from "isitthere";
const elm = document.getElementById("iAmADOMElement");
const results = isItThere(elm);
console.log(results);
// {
// topVisible: True,
// bottomVisible: False,
// percentVisible: 0.55,
// }