infinite scrolling in iScroll4 or improve inertia/momentum

1.8k Views Asked by At

I've been trying to get this figured out for a few months now and have exhausted everything I can think of.

What I'm trying to achieve is: http://blue.bluestudios.kenzomedia.com/v0.7/ (some logic borrowed from iScroll4)

Notice that you can keep scrolling. This works fine in that example. The issue is that it's not completely smooth like iScoll4.

So I've been trying to do the same using iScroll4 with blue.bluestudios.kenzomedia.com/v0.8/ but I can't seem to figure out how to get it to "repeat" correctly. It seems to be something with startX and startY but I've tried so many different pieces of code at this point and really can't think of anything else to do. If you are simply moving your mouse/finger it will repeat with no issue. It's only when animating.

http://blue.bluestudios.kenzomedia.com/v0.8/assets/js/libs/iscroll.ext.js this is where I have the working _move function.

Again, tried to do the same in the animate function with no luck.

Any suggestions at this point would be extremely helpful. And this is for either figuring out how to get iScroll4 to do what I'd like or to improve the animation on v0.7.

1

There are 1 best solutions below

1
On

I see that you have too many nested elements within your iscroll wrapper div. Remove all those div's that are not required. This degrades performance. I just made a simple test by deleting some of the nested element in firebug and the performance improved immensely. As the documentation in http://cubiq.org/iscroll-4 try to keep the DOM structure as simple as possible, remove all the unnecessary tags and avoid too many nested elements. I believe this will make your iscroll smooth once you try this out