Skip to content Skip to sidebar Skip to footer

Load Data On Scroll Down For Bootstrap Model (lazy Load)

I have bootstrap modal that have scrolling. I want to load data from AJAX call when scroll hit modal bottom (Not Page Bottom). I am using this jQuery code but its not working for t

Solution 1:

You need to identify whether modal-body has reached bottom as you are scrolling modal-body so change window to modal-body as below:

$('.modal-body').scroll(function() {
  if($(this).scrollTop() + $(this).innerHeight() >= this.scrollHeight) {
       alert('reached bottom');
  }
});

Bootply here

Post a Comment for "Load Data On Scroll Down For Bootstrap Model (lazy Load)"