ProgrammerGuide.Net | Step by Step Programmer Guide

Firing An Event When The ScrollBar Reaches Webpage Bottom Using jQuery | jQuery Tutorial

The JavaScript code snippet below shows an alert message when the scroll bar hits the bottom of the page. The jquery scroll function will be fired every time we scroll the page. However, we restrict the logic to execute by putting this inside a conditional statement that determines the position of the scroll bar.
$(window).scroll(function(){
  if($(window).scrollTop() == $(document).height() - $(window).height() ){

    alert("reached bottom of the page");

  }
}
Please click here for related products on Amazon!

Jayashee

Add comment

Want to Check Celebrities News?