Ok I've been searching and searching for an answer, but have yet to find one in the general area I am looking for. Not being supremely familiar with iScroll (a former developer on this project added it in, and I am now taking it over). I have been trying to figure out where to begin with iScroll.
Right now all seems to work accordingly as far as scrolling up and down. But I want to add some functionality to the overall app thats been developed, such as getting older data and appending it to the more recent data thats listed at that time. An infinite scroll.
Pulling in the data via ajax, and working with it to append it to and refresh iScroll length isn't so much the issue (I think, well for the moment at the least). What is my issue is finding that moment when the bottom is reached and firing off the function I will make to get said data and append it.
I can't find any examples anywhere so I am hoping someone here can throw me some ideas
Since this question is pretty old. This solution is for any future references.
Using iScroll v4.2.5:
var scroll = new iScroll('scroll-wrapper');
scroll.options.onScrollEnd = function(){
if(Math.abs(this.maxScrollY) - Math.abs(this.y) < 10){
// RUN CODE if scroll is 10px from the bottom.
}
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With