我已经尝试了一段时间来完成这项工作。这种方法似乎适用于互联网上的几个地方,但不适用于我。请注意,当我在手机上试用它时,这在 Dreamweaver(和 chrome)中有效,但在 Eclipse Indigo(Phonegap) 中无效。
 $("#button4").mouseup(function(){
 //  clearTimeout(pressTimer);
    pressTimer = 0;
   // Clear timeout
   return false;
 }).mousedown(function(){
   // Set timeout
   pressTimer = window.setTimeout(function() { test(); },1000);
   return false; 
 });
 function test ()
 {alert("Longpress works");}
正常的“点击”也适用于“button4”。