1. 程式人生 > >jQuery禁止滑鼠右鍵

jQuery禁止滑鼠右鍵

jQuery遮蔽滑鼠右鍵:

$(document).ready(function(){  
    $(document).bind("contextmenu",function(e){   
          return false;   
    });
});

--------------------------------------------------------------------------------------------------

JS遮蔽滑鼠右鍵:

<scriptlanguage="JavaScript">
    document.oncontextmenu=newFunction("event.returnValue=false;");
    document.onselectstart=newFunction("event.returnValue=false;");
</script>

--------------------------------------------------------------------------------------------------

jquery禁止右鍵彈出的突破方法:

如: $(document).bind("contextmenu", function() { returnfalse; });  //這段JS程式碼將禁止右鍵彈出

突破方法:
位址列中輸入:javascript:alert($(document).unbind("contextmenu",""));

css <a>標籤 點選禁止跳轉到頂部

《a href="javascript:void(0)"onclick="getcontent(1)"》得到內容《/a》

禁止右鍵的程式碼:

    $('body').bind('contextmenu',function() {
      returnfalse;
    });

禁止複製的程式碼:

$('body').bind("selectstart",function(){return false;});
本文來自:牛人技術網 連結地址:http://bbs.51web.org/read.php?tid=4

jquery禁止a標籤的提交方法

$("a").live('click', function(event) { 


  event.preventDefault();   
});