Working fork of iScroll 4 with extended acceleration

The problem that I had introduced in my iScroll 4 code just needed a simple fix. This was the code I had in my local file.

speed = m.abs(dist) / time + (addVelocity ? velocity : 0)

Speed should always result in a positive number, when velocity was negative then obviously the end result could be negative. In addition the effects were quite strange since sometimes multiple touchmoves would result in the speed being lower when it should have been higher… The above code was simply replaced with this

speed = m.abs(dist) / time + (addVelocity ? m.abs(velocity) : 0)

A working version of the finished code has been commited to GitHub in my iScroll 4 fork. This version should result in higher speed inertia when the user performs multiple consecutive scroll movements with iScroll. The code has been tested on Android 2.1 and 2.3, I will be testing on iOs over the coming weeks.

Leave A Comment...