i have created a little slide show in jQuery. On clicking-n-dragging your mouse it shows next/previous slide. I have added special code for dealing with iphone. But on iphone (safari) when i move my finger over the object the whole page is dragged left-right. here is the code
var oldX = 0;
$('#movieShow').bind('touchstart',function(e){
if(e.touches.length == 1){
var touch = e.touches[0];
oldX = touch.pageX;
}
return false;
}).bind('touchmove',function(e){
if(e.touches.length == 1){
var touch = e.touches[0];
if((touch.pageX - oldX) > 0){
var t = touch.pageX - oldX;
if(t%5==0){
oldX = touch.pageX;
rightClick();
}
}
else{
var t = oldX - touch.pageX;
if(t%5==0){
oldX = touch.pageX;
leftClick();
}
}
}
return false;
});
how do i cancel defaults iphone event?