Javascript Scroll Bottom Event

How to trigger the scroll event in javascript

Solution

To identify the scroll event of HTML page in javascript, window scroll event can be used as applied in following sample

$(function () {
 $(window).on('scroll', function () {
    var scrollHeight = $(document).height();
    var scrollPosition = $(window).height() + $(window).scrollTop();
    if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
    //my code here
    }
  });
});

More Questions