I am trying to make infinite scroll inside classic bootstrap modal, in modal body (element $('.modal-body')) which I set as scrollable. My problem is to define the condition for loading more data when scroll bar hits the bottom of modal body. I found one some working example for the whole window (below), but not for modal window. Can you help me how to rewrite that code for modal body? Thanks.
$(window).scroll(function () {
if ($(window).scrollTop() == $(document).height() - $(window).height())
{
//just some logic for get more data
}
});
I understand it should be something like $('.modal-body').scroll..... but the inner condition is not clear for me.