I\'ve been able to successfully play with the touchstart, touchmove, and touchend events on Android using jQuery and an HTML page. Now I\'m trying to see what the trick is t
Why not just use a js timer? I did something like:
i=0;
$drink = document.getElementById('drink');
$drink.addEventListener('touchstart',function(event){
$('#drink .mainBtnText').text('HOLD'); //mostly for debugging
t = window.setInterval(function(event){
i+=.5;
if (i>=1){
alert('taphold');
window.clearInterval(t);
i=0;
}
},500);
});
$drink.addEventListener('touchend',function(event){
$('#drink .mainBtnText').text('Drink');
i=0;
window.clearInterval(t);
});
And I've had absolutely no trouble with it thus far...admittedly, I haven't done incredibly extensive device testing, but it's worked on my desktop (with mousedown/mouseup) as well as an HTC Droid Eris (Android 1.6) and my Droid RAZR (Android 2.3)...