2013-06-08 1 views
0

나는 안드로이드 전화 갭 app.what을 만들었습니다. 나는 우리가 오랫동안 버튼을 누르면 "당신은 계정을 삭제 하시겠습니까?"라는 메시지를 표시해야하는 응용 프로그램에서 삭제 버튼을 가지고 있습니다. 우리는 클릭 기능을 사용하여 올바르게 작동하는지 오래 언론에 대해 아무도이를 알릴 수 없습니다. 여기에 내가 미리phonegap android에서 길게 누르는 이벤트를 만드는 방법은 무엇입니까?

답변

0

사용 버튼을 클릭 리스너 내부 통지에 길게 누르에 대한

$(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 
    ); 
    } 

... Phone gap doc입니다

+0

안녕하세요 rply하지만 주셔서 감사합니다 rply하지만 그것의 작동 onclick 기능을 원하는대로 표시 메시지 만 사용자가 길게 누르면 단추입니다 .. –

관련 문제