This wouldn’t be called a tutorial, its an example of how to detect when you reach the bottom of the document (page). This example could be used to call a function when the user scrolls and reaches an element. Please, check my second example.

It works simply by adding the scroll top and window height, compares that to the whole document height and if its equal, returns the alert message. Please, exchange the alert message with your custom code.

If you find my blogging useful, please share it.