Javascript android 2.2浏览器在ontouchend事件中无法运行pageY或PageX

Javascript android 2.2浏览器在ontouchend事件中无法运行pageY或PageX,javascript,android-2.2-froyo,Javascript,Android 2.2 Froyo,我有一个在android 2.1中运行完美的web应用程序,当我在ontouchend事件中将pageX属性升级到2.2时,这是我的代码: menu1.ontouchend = function(e){ e.preventDefault(); if (e.touches && e.touches.length>0) { // iPhone x2 = e.touches[0].pageX; y2 = e.touches[0].pageY; } else { // all other

我有一个在android 2.1中运行完美的web应用程序,当我在ontouchend事件中将pageX属性升级到2.2时,这是我的代码:

menu1.ontouchend = function(e){ e.preventDefault(); if (e.touches && e.touches.length>0) { // iPhone x2 = e.touches[0].pageX; y2 = e.touches[0].pageY; } else { // all others x2 = e.pageX; y2 = e.pageY; } } menu1.ontouchend=函数(e){ e、 预防默认值(); 如果(e.touchs&&e.touchs.length>0){//iPhone x2=e.L[0].pageX; y2=e.touchs[0].pageY; }否则{//所有其他 x2=e.pageX; y2=e.pageY; } } 任何人都知道触摸事件的javascript API从2.1到2.2有什么变化吗?

您可以尝试:

event.targetTouches[0].pageX


如果这不起作用,请检查是否可以从“touchmove”事件获取此属性。如果是,则存储该值(在“touchmove”事件中访问该值时),并在“touchend”事件中加载该值。

据我所知,startX和startY也会被破坏。我还没有找到解决办法。