2017-08-17 50 views
0

它的Jquery,html,css基於應用程序使用科爾多瓦來構建APK。如何禁用日誌按默認行爲科爾多瓦android

我有另一個功能在屏幕上長按執行,它通過點擊兩個字符串的中間來工作,以避免默認對話框。大多數情況下,默認設備長按對話框彈出窗口出現在屏幕上方。如何禁用顯示在下方屏幕截圖中的頂部部分?嘗試了一些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

你試過mouseup,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 * 
    }