Javascript code to detect when we are at bottom of the scroll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onscroll = function() { | |
// @var int totalPageHeight | |
var totalPageHeight = document.body.scrollHeight; | |
// @var int scrollPoint | |
var scrollPoint = window.scrollY + window.innerHeight; | |
// check if we hit the bottom of the page | |
if(scrollPoint >= totalPageHeight) | |
{ | |
console.log("at the bottom"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment