Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 861 Bytes

bottomVisible.md

File metadata and controls

26 lines (21 loc) · 861 Bytes
title tags author_title author_url author_image_url description image
bottomVisible
browser
intermediate
Deepak Vishwakarma
Implementation of "bottomVisible" in typescript, javascript and deno.

JS

Returns true if the bottom of the page is visible, false otherwise.

Use scrollY, scrollHeight and 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