Checks if the bottom of the page is visible.
Window.scrollY
, Element.scrollHeight
and Element.clientHeight
to determine if the bottom of the page is visible.const bottomVisible = () =>
document.documentElement.clientHeight + window.scrollY >=
(document.documentElement.scrollHeight ||
document.documentElement.clientHeight);
bottomVisible(); // true
JavaScript, Browser
Checks if the element specified is visible in the viewport.
JavaScript, Browser
Checks if the browser tab of the page is focused.
JavaScript, Browser
Redirects the page to HTTPS if it's currently in HTTP.