bottomVisible
Checks if the bottom of the page is visible.
- Use
scrollY,scrollHeightandclientHeightto determine if the bottom of the page is visible.
const bottomVisible = () =>
document.documentElement.clientHeight + window.scrollY >=
(document.documentElement.scrollHeight ||
document.documentElement.clientHeight);bottomVisible(); // true