2017-08-17 9 views
0

Jqueryhtmlcssベースのアプリケーションで、Cordovaを使用してAPKを構築します。ログプレスのデフォルトの動作を無効にする方法cordova android

私は別の機能を画面上で長押しして実行していますが、デフォルトのダイアログを避けるために、2つの文字列の中央をクリックして機能しています。ほとんどの場合、デフォルトデバイスの長押しダイアログのポップアップが画面上部に表示されます。下のスクリーンショットに表示されている上部を無効にするにはどうすればよいですか?いくつかcssJavascriptのトリックを試してみましたが、何も役に立ちません。ここで

Check screenshot here

は、長押し]ダイアログボックスのコードです

$(document).on("mousedown touchstart","#table_discrepancy tr", function() { 

var orderno = $(this).find("td:eq(0)").text(); 
var workorderno = $(this).find("td:eq(1)").text(); 

var timer = setTimeout(function() { 

    server('/get_customer_info/' + orderno, function(result){ 

    var cus_name = result.name.replace(/^[\s]+/, ''); 
    cus_name = cus_name.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); 
    var phone_no = result.phoneno.replace(/^[\s]+/, ''); 
    var email = result.email.replace(/^[\s]+/, ''); 

      $('#customer_info_modal').modal('show'); 

      $('#orderno_modal').html('Order# : ' + orderno); 
      $('#workorderno_modal').html('Work Order# : ' + workorderno); 
      $('#customer_name_modal').html('Name : ' + cus_name); 
      $('#customer_phoneno_modal').html('Phone#: ' + phone_no); 
      $('#customer_email_modal').html('Email: ' + email); 
    }); 

    }, 1000); 

$(this).on("mouseup touchstart", function() { 
    clearTimeout(timer); 
}); 
}) 
+0

あなたのコードを追加してください – Observer

+0

マウスアップ、mousedownを試しましたか? – amyogiji

+0

はい@AghoriTantrik – Nick

答えて

0

体で定義したクラスとCSSを追加することによってブロックされ、それが画面から何かを選択することはできません

.noselect { 
    -webkit-touch-callout: none; /* iOS Safari */ 
    -webkit-user-select: none; /* Safari */ 
    -khtml-user-select: none; /* Konqueror HTML */ 
    -moz-user-select: none; /* Firefox */ 
    -ms-user-select: none; /* Internet Explorer/Edge */ 
    user-select: none; /* Non-prefixed version, currently 
           supported by Chrome and Opera * 
    } 
関連する問題