This script works on iPhone, Android 2.1, and Dolfin (Samsung bada). It does not work on Android 2.2
The reason is that I read out event.touches[0].clientX
, which tells me where the user’s
finger is, from the touchstart event object. This works fine in iPhone and bada: the touchstart event object
is continually updated even if the touchstart event itself has long gone.
That also used to be the case in Android 2.1, but 2.2 seems to stop updating the touchstart event object after the touchstart event has quit. As far as I’m concerned this is a bug, since both other touch browsers do support this trick.
The solution is to read out the coordinates ontouchmove and ontouchend
from changedTouches
; this array always exists while touches
doesn’t. Still,
this workaround does not mean there is no bug.