Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery Mobile taphold事件触发浏览器对话框_Jquery_Android_Jquery Plugins - Fatal编程技术网

jQuery Mobile taphold事件触发浏览器对话框

jQuery Mobile taphold事件触发浏览器对话框,jquery,android,jquery-plugins,Jquery,Android,Jquery Plugins,我对Tapphold事件有问题 我将taphold事件绑定到图像。当我快速点击图像时,android web浏览器会触发一个对话框,其中包含“另存为图像”、“设置为壁纸”、“共享图像”命令 我想在使用taphold事件时禁用图像处理命令对话框 是否可能?调用e.preventDefault()以防止弹出对话框 $page.bind("pageinit", function () { $("a").bind("taphold", function (e) { // your

我对Tapphold事件有问题

我将taphold事件绑定到图像。当我快速点击图像时,android web浏览器会触发一个对话框,其中包含“另存为图像”、“设置为壁纸”、“共享图像”命令

我想在使用taphold事件时禁用图像处理命令对话框

是否可能?

调用e.preventDefault()以防止弹出对话框

$page.bind("pageinit", function () {
    $("a").bind("taphold", function (e) {
        // your code
        e.preventDefault();
    });
});
编辑:

那么绑定到img呢

$page.bind("pageinit", function () {
    $("img").bind("taphold", function (e) {
        // your code
        e.preventDefault();
    });
});
调用e.preventDefault()以防止对话框弹出

$page.bind("pageinit", function () {
    $("a").bind("taphold", function (e) {
        // your code
        e.preventDefault();
    });
});
编辑:

那么绑定到img呢

$page.bind("pageinit", function () {
    $("img").bind("taphold", function (e) {
        // your code
        e.preventDefault();
    });
});

我发现你必须禁用右键单击

$(function(){

    document.oncontextmenu = function() {return false;};

    $(document).mousedown(function(e){

        if ( e.button == 2 )
        { 
            alert('Right mouse button!'); 
            return false; 
        }

        return true;
    });
});

我发现你必须禁用右键单击

$(function(){

    document.oncontextmenu = function() {return false;};

    $(document).mousedown(function(e){

        if ( e.button == 2 )
        { 
            alert('Right mouse button!'); 
            return false; 
        }

        return true;
    });
});

是的,这是可能的。我被以下代码清除了相同的问题

     window.oncontextmenu = function (event) {
    event.preventDefault();
    event.stopPropagation();
    return false;
      };

是的,这是可能的。我被以下代码清除了相同的问题

     window.oncontextmenu = function (event) {
    event.preventDefault();
    event.stopPropagation();
    return false;
      };

我的页面上没有“锚”:(绑定到锚以外的其他对象时,我的研究结果似乎不起作用。我的页面上没有“锚”:(绑定到锚以外的对象时,我的研究结果似乎不起作用。