Merge pull request #54 from fhdhsni/master

Add bottomVisible
This commit is contained in:
Angelos Chalaris
2017-12-13 14:14:46 +02:00
committed by GitHub
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,9 @@
### Bottom visible
Use `scrollY`, `scrollHeight` and `clientHeight` to determine if the bottom of the page is visible.
```js
const bottomVisible = _ =>
document.documentElement.clientHeight + window.scrollY >= document.documentElement.scrollHeight || document.documentElement.clientHeight;
// bottomVisible() -> true
```