ios上的Mousedown和mouseup与mac上的safari和firefox不同

时间:2015-12-13 12:58:54

标签: javascript ios css

我将两个eventListener()添加到html按钮,这样我就可以检测到长按。它适用于Mac上的safari和firefox,但是当我在iphone / ipad或模拟器中打开ios中的相同网页时,会出现复制/粘贴弹出菜单。

我找到了Preventing default context menu on longpress / longclick in mobile Safari (iPad / iPhone)How to disable the default behavior of an Anchor in jQuery Mobile (iOS)

解决了弹出窗口,将以下内容添加到css:

$(document).ready(function () {
       var id = 1;
                    $.post("dashboardprocessor.php", {c1:id},function(data){
                    $("#c1").html(data);

                    });

    }); 

如果按钮保持x ms。它应该执行一些功能。当我在警告消息中打印mouse_delta时,它显示2(ms。),即使我按住按钮几秒钟。因此它可能是ios中的省电功能。

Javascript(部分):

html {
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
}

我如何在ios上解决这个问题?

问候 克劳斯

0 个答案:

没有答案
相关问题