Jumpy behavior in Chrome, FF, Safari if scroller div is shorter than wrapper div
If the contents of the scroller div are not tall enough to stretch it to a greater height than the wrapper div, you'll see mega-jumpy behavior in latest Chrome, FF and Safari builds. The list (or whatever it is you're trying to scroll) will jump up and down wildly if scrolling down. Scrolling up poses no problems.
In my circumstance, I was able to patch it with
_startAni: function () {
// immediately after variable delcaraitons
if (that.wrapper.offsetHeight > that.wrapper.children[0].offsetHeight) return;
but I imagine that this isn't appropriate for everyone. I'll be happy to make this a param in the options and submit a Pull Request, unless you think there's a more elegant solution. Thanks!
Are you testing the latest version? I can't replicate this issue.
I'm able to replicate it, even on the iScroll demo at http://cubiq.org/dropbox/iscroll4/examples/simple/ .
Here's a video I made of it: http://screencast.com/t/3TTZaGHBTk . It's actually jumping much more rapidly than that, but the low frame rate couldn't capture it.
I was able to create this situation by opening Chrome's WebKit Inspector and deleting enough of the <li> elements so that the <ul> was shorter than the viewport. Then simply scroll down. The same situation is happening with the most recent iScroll.js in a backbone.js app I'm working on. Thanks!
You have to call refresh() method if you remove LIs from the inspector
video http://cubiq.org/dropbox/chrome-test.mov
Hey Matteo, I failed to mention that I'm experiencing this with a trackpad on a new MacBook Air.
I repeated the steps in your video, and still experienced the problem on the iScroll demo. My backbone app is also calling refresh() automatically after loading in list items, and the same behavior is occurring there.
Any ideas?
v4 or earlier is unsupported. Please check out v5 if you have this issue.
There are some trackpad issues with iScroll 5 as well, currently, but we are working on improving that.