【发布时间】:2018-01-26 09:25:21
【问题描述】:
它是基于 Jquery、html、css 的应用程序,使用 Cordova 构建 APK。
我在屏幕上长按另一个功能,它通过单击两个字符串的中间来工作,以避免默认对话框。大多数情况下,默认设备长按对话框弹出窗口出现在屏幕顶部。如何禁用下面屏幕截图中显示的顶部?尝试了一些 css 和 Javascript 技巧,但没有任何帮助。
这是长按对话框的代码
$(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);
});
})
【问题讨论】:
-
请添加您的代码
-
你试过 mouseup , mousedown 吗?
-
是的@AghoriTantrik
-
代码添加@Observer
-
尝试做“mousedown touchstart”和“mouseup touchstart”
标签: javascript android jquery css cordova