如何在phonegap android中创建长按事件?

如何在phonegap android中创建长按事件?,android,cordova,Android,Cordova,我已经创建了一个android phone gap应用程序。我想做的是,我的应用程序中有一个删除按钮,当我们长按按钮时,它会显示一条符合要求的消息,“你想删除帐户吗”我们使用了一个点击功能,它工作正常,它不工作,长按可以告诉谁这样做。 这是我为longpress使用的代码 $(document).on(function(){ $("#taphold").bind("taphold",function(){ var hi=confirm("Do you really want to del

我已经创建了一个android phone gap应用程序。我想做的是,我的应用程序中有一个删除按钮,当我们长按按钮时,它会显示一条符合要求的消息,“你想删除帐户吗”我们使用了一个点击功能,它工作正常,它不工作,长按可以告诉谁这样做。 这是我为longpress使用的代码

$(document).on(function(){
$("#taphold").bind("taphold",function(){
    var hi=confirm("Do you really want to delete data");
    if(hi==true) {
        db.transaction(function(tx){
            tx.executeSql(deleterecord,[id]);
            alert("Record Deleted Successfully");
            parent.location='file:///android_asset/www/index.html';
        });
    }else{
        alert("Data not deleted");
    }
});});

提前感谢

使用按钮内的通知单击列表

     // process the confirmation dialog result
    function onConfirm(button) {
    alert('You selected button ' + button);
    }

    // Show a custom confirmation dialog
    //
    function showConfirm() {
    navigator.notification.confirm(
    'You are the winner!',  // message
    onConfirm,              // callback to invoke with index of button pressed
    'Game Over',            // title
    'Restart,Exit'          // buttonLabels
    );
    }

有关更多信息,请检查..

嘿,感谢rply,但其工作原理与onclick功能相同。我想要的是,它仅在用户长按按钮时显示消息。。