解决方案 »

  1.   

    你在弹出自己做的菜单的事件也让他return false;或者event.preventDefault()
      

  2.   

    没办法,return false只是阻止浏览器默认事件。你写的右键菜单本身是执行自己的方法,并且阻止了浏览器默认事件。只能设置一个变量,在右键的时候判断是不是要弹出右键菜单。每次更新这个变量就可以了。
      

  3.   


    $('.file_list').mousedown(function(e){
    var path = $(this).attr('path');
    var name = $(this).attr('name');
    var file_id = $(this).attr('file-id');
    //var file_info = {'path':path, 'name':name, 'file_id':file_id};
    //localStorage.setItem('file_info', file_info);
    localStorage.setItem('path',path);
    localStorage.setItem('name',name);
    localStorage.setItem('file_id',file_id);
    if(3 == e.which){
    e.preventDefault();
    var offsetLeft = e.pageX;
    var offsetTop = e.pageY;
    var tipStyle = 'top:'+offsetTop+'px;left:'+offsetLeft+'px;';
    $('#file_action').hide();
    $('#folder_action').hide();
    if($('#file_action').css('display') == 'none'){
    $('#file_action').attr('style',tipStyle).show();
    }else{
    $('#file_action').hide();
    }
    }
    });现在我就是全局屏蔽。。
    $(document).bind('contextmenu',function(){
    return false;
    });
      

  4.   

    $('.file_list').mousedown(function(e){
    改用
    $('.file_list').bind('contextmenu',function(e){
      

  5.   

    那我mousedown写哪里?写在bind里还是什么?
      

  6.   

    一定要用mousedown事件的话可以这样$('.file_list').mousedown(function(e){
    //代码。。
    }).bind('contextmenu',function(e){
    e.preventDefault();
    return false;
    });
      

  7.   


    <html>
    <head>
    <SCRIPT src="./jquery-1.11.1.js" type="text/javascript"></SCRIPT>

    </head>
    <body>
    <div id="aaa" style="height:1000px;widht:1000px;background:red">aaa
    <div id="bbb" style="height:500px;width:500px;background:green">bbb</div>
    </div>
    </body>
    <script>
    $(document).ready(function() {


    $(document).bind('contextmenu',function(){
    return false;
    });
    $("#bbb").mousedown(function(){
    alert("bbb");
    return false;
      });
    /*

    */
    });
     
    </script>
    </html>
      

  8.   


    <html>
    <head>
    <SCRIPT src="./jquery-1.11.1.js" type="text/javascript"></SCRIPT>

    </head>
    <body>
    <div id="aaa" style="height:1000px;widht:1000px;background:red">aaa
    <div id="bbb" style="height:500px;width:500px;background:green">bbb</div>
    </div>
    </body>
    <script>
    $(document).ready(function() {


    $("#aaa").bind('contextmenu',function(){
    return false;
    });
    $("#bbb").mousedown(function(){
    alert("bbb");
    return false;
      });
    /*

    */
    });
     
    </script>
    </html>
    我这样也可以啊 版本 40.0.2214.111 m