2013-03-05 132 views
0

我使用适用于iOS,Android和Windows Phone的Cordova 2.2.0框架编写应用程序。 我有以下两种工作的代码:Android和iOS,但不支持Windows Phone 7.5。Windows Phone 7.5 touchend事件未被触发

$(document).ready(function() 
{ 
    //document.addEventListener("deviceready", devReady, false); 
    devReady(); 
}); 

function devReady() 
{      
    document.getElementById('index_login_butt').addEventListener('touchend',  indexLoginClicked, false); 
} 


function indexLoginClicked() 
{  
     //console.log("######## indexLogin"); 
     var color = $(this).css("background-color"); 
     var lighter = lighterColor(color, .1); 
     $(this).css("background-color", lighter); 
} 

我花了整整一天的时间来找出为什么这段代码不起作用。我不知道在哪些/我该如何初始化这些块来使它们工作。我试图在互联网上看,但无法找到任何有用的..我做错了什么?

回答

1

Windows Phone 7.x的Internet Explorer 9 Mobile没有实现触摸API。你必须诉诸使用“点击”事件。

+0

谢谢你,你说得对。现在我可以看到我应该使用mousedown事件。再次感谢你。 – Konrad 2013-03-05 21:09:29