To be or not to be.That is a question!

---源于莎士比亚的《哈姆雷特》

导航

ios7 webapp touch bug

// ios7 touchstart bug
if(navigator.userAgent.indexOf("iPhone OS 7") != -1){
var startX = 0 , startY = 0;
$('#recommendSubmit').bind("touchstart",function(){
event.preventDefault();
startX = event.changedTouches[0].pageX;
startY = event.changedTouches[0].pageY;
});

$('#recommendSubmit').bind("touchend",function(e){
var endX = event.changedTouches[0].pageX;
var endY = event.changedTouches[0].pageY;
if(Math.abs(endX - startX) < 20 && Math.abs(endY - startY) < 20){
$('#recommendedNumber').blur();
$(this).trigger('click');
}
event.preventDefault();
});
}

posted on 2014-06-04 19:04  Ijavascript  阅读(166)  评论(0编辑  收藏  举报