Jquery call function on scroll down bottom


Jquery call function on scroll down bottom : If are going to bind and event with the scroll bar of page when it reaches to the bottom of the page. You can following jQuery method for this type of events.


Jquery call function on scroll down bottom Syntax

The event will be fired when scroll bar goes to the bootom of the page. The best example for this event can be auto loading data on scroll down. For Example Facebook auto loads posts when you scrolls down.

Here is syntax for scroll down bottom event-

jQuery(document).ready(function(){  
    jQuery(window).scroll(function(){
    if (jQuery(document).height() - (jQuery(window).scrollTop() + jQuery(window).height()) < 100){
         //jQuery('#myDiv').slideUp();
         // your_function();
         alert("Scroll Bottom Reached.");
      }else{
         //jQuery('#myDiv').slideDown();
      }
    });
  });

Here is an image which have scroll bar at the bottom of the page -

Jquery call function on scroll down bottom


Advertisements

Add Comment

📖 Read More