pklauzinski / jscroll

An infinite scrolling plugin for jQuery.
http://jscroll.com/
1.11k stars 563 forks source link

Using jscroll in Bootstrap modal? #130

Open julianpring opened 7 years ago

julianpring commented 7 years ago

I want to add jscroll to a Bootstrap modal, however, I can't seem to find a way to implement it.

Here is a JSFiddle I started:

http://jsfiddle.net/DTcHh/33284/

What would the jscroll JS look like to implement jscroll in the modal?

Additionally, is it possible to return a JSON response in a different format, and grab the HTML from one of the properties and append it to the modal? For example, if I had a response that looked like:

{"success":true,"data":{"html":"<HTML TO APPEND TO MODAL HERE>"}}

Thanks,

julianpring commented 7 years ago

@pklauzinski Any ideas?

alvinzjoe commented 4 years ago

Would just leave it here:

$("#yourModalName .modal-body").scroll(function () {
        if($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) {
                  $('.pagination').last().find('li.active + li a').click()
        }
});