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
After along day, i have implemented a smooth infinite scroll and pull to refresh sample app using iscroll4. these two functionality were implemented in one sample app i created. hope its useful to this mobile app developer community.
first it is assumed that:
my app summary:
when user loads my app, it makes an ajax call to json/php file on my server and some values are returned.
Problem nature: i want infinite scrolling alongside pull to refresh functions and i dont want to use any other framework apart from iscroll4.
my solution:
next is to create the myinitialloadscript.js script. this allows content to be loaded into the app for the first time on that page.
next is to implement pulltorefresh.js much woun't be said about this because the example in iscroll4 is clear.
and last but not the least the main infinitescroll.js recall that we had previously placed a call to this function in pulltorefresh.js where we said if scroll bar is 10px to the end inifite scroll should be triggered. Then we have this as the shot to be fired.
so just in case you are lost with what the php file should look like here you go. This file is landing.php
this next file is for infinite scrolling and it is called landing_more.php
Since this question is pretty old. This solution is for any future references.
Using iScroll v4.2.5: