2011-12-06 9 views
0

jQueryとビューポートメタタグを使用してモバイルウェブサイト(Safari Mobileではなくuiwebview)を制作しています。iOS4は左スワイプを検出できません

<meta name="viewport" content="width=500, user-scalable=0, initial-scale=default" id="viewport"> 

私はjQueryのtouchSwipeプラグインを介して、作業http://labs.skinkers.com/touchSwipe/

$(window).swipe({ 
    swipeLeft :function(){ console.log('1'); arrows.eq(1).click(); }, 
    swipeRight :function(){ console.log('0'); arrows.eq(0).click(); }, 
    allowPageScroll:"vertical" 
}); 

を検出しているスワイプスワイプは、iPadのiOS5をとAndroid上の微細検出しますが、iPhone iOS4を何もトリガません。私はいくつかのデバッグをしました

document.ontouchstart = function(e){ 
    console.log(e.touches[0].clientX+' | '+e.touches[0].clientY); 
}; 

すべての基本を試しましたclientX pageX ect。すべて正常に動作し、有効なデータを返すようです。誰でもアイデアはありますか?

+0

私はまた、奇妙なことに同じ結果を持つhttp://jgestures.codeplex.com/documentationを試しました。 – Fresheyeball

答えて

0

解決済みこの問題は非常に単純でした。

$(window) 

iOS5とAndroidでは、iOS4でタッチイベントは受信されません。 While

$(document) 

すべてのデバイスでタッチイベントを受信します。 Go figure。

関連する問題