精品国产免费观看久久久_久久天天躁狠狠躁夜夜爽_无码人妻少妇久久中文字幕_狠狠做深爱婷婷久久综合一区

設計觀點

精準傳達 ? 價值共享

洞悉互聯網前沿資訊,探尋網站營銷規律

查看其它板塊

網頁中禁止右鍵 查看 復制代碼

作者:Smileby陌少羽 | 2017-06-14 18:47 |點擊:

1.禁止鼠標左右鍵
  1. <SCRIPT language=javascript>
  2. <!--
  3. if (window.Event)
  4. document.captureEvents(Event.MOUSEUP);
  5. function nocontextmenu(){
  6. event.cancelBubble = true
  7. event.returnValue = false;
  8. return false;
  9. }
  10. function norightclick(e){
  11. if (window.Event){
  12. if (e.which == 2 || e.which == 3)
  13. return false;
  14. }
  15. else
  16. if (event.button == 2 || event.button == 3){
  17. event.cancelBubble = true
  18. 18 event.returnValue = false;
  19. 19 return false;
  20. }
  21. }
  22. document.oncontextmenu = nocontextmenu; // for IE5+
  23. document.onmousedown = norightclick; // for all others
  24. //-->
  25. </SCRIPT>
復制代碼
2禁止鼠標左右鍵代碼/禁止網頁選中/禁止另存為/防復制代碼
  1. <body oncontextmenu="return false" onselectstart="return false">
  2. <noscript><iframe src="/*.html>";</iframe></noscript>
  3. <script>
  4. function stop(){
  5. return false;
  6. }
  7. document.oncontextmenu=stop;
  8. </script>
復制代碼
3禁止選中代碼
  1. <SCRIPT language=JavaScript>
  2. document.oncontextmenu=new Function("event.returnValue=false;");
  3. document.onselectstart=new Function("event.returnValue=false;");
  4. </SCRIPT>
復制代碼
4.禁止另存為
  1. <noscript>
  2. <iframe src="/*.htm"></iframe>
  3. </noscript>
復制代碼
5.防拷貝/復制代碼
  1. <body leftmargin=0 topmargin=0 >
復制代碼
6.禁止選擇文本
  1. <script type="text/javascript">
  2. var omitformtags=["input", "textarea", "select"]
  3. omitformtagsomitformtags=omitformtags.join("|")
  4. function disableselect(e){
  5. if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
  6. return false
  7. }
  8. function reEnable(){
  9. return true
  10. }
  11. if (typeof document.onselectstart!="undefined")
  12. document.onselectstart=new Function ("return false")
  13. else{
  14. document.onmousedown=disableselect
  15. document.onmouseup=reEnable
  16. }
  17. </script>
復制代碼
7.禁止網頁另存為
  1. <noscript><iframe src="/*.html>";</iframe></noscript>
復制代碼
8.禁止選擇文本
  1. <script type="text/javascript">
  2.  
  3. var omitformtags=["input", "textarea", "select"]
  4.  
  5. omitformtagsomitformtags=omitformtags.join("|")
  6.  
  7. function disableselect(e){
  8. if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
  9. return false
  10. }
  11.  
  12. function reEnable(){
  13. return true
  14. }
  15.  
  16. if (typeof document.onselectstart!="undefined")
  17. document.onselectstart=new Function ("return false")
  18. else{
  19. document.onmousedown=disableselect
  20. document.onmouseup=reEnable
  21. }
  22. </script>
復制代碼
9.禁用右鍵
  1. <script>
  2. function stop(){
  3. return false;
  4. }
  5. document.oncontextmenu=stop;
  6. </script>
復制代碼
11.真正的鼠標右鍵屏蔽
  1. <script language="JavaScript">
  2. <!--
  3.  
  4. if (window.Event)
  5. document.captureEvents(Event.MOUSEUP);
  6.  
  7. function nocontextmenu()
  8. {
  9. event.cancelBubble = true
  10. event.returnValue = false;
  11.  
  12. return false;
  13. }
  14.  
  15. function norightclick(e)
  16. {
  17. if (window.Event)
  18. {
  19. if (e.which == 2 || e.which == 3)
  20. return false;
  21. }
  22. else
  23. if (event.button == 2 || event.button == 3)
  24. {
  25. event.cancelBubble = true
  26. event.returnValue = false;
  27. return false;
  28. }
  29.  
  30. }
  31.  
  32. document.oncontextmenu = nocontextmenu; // for IE5+
  33. document.onmousedown = norightclick; // for all others
  34. //-->
  35. </script>
復制代碼
以上由 重慶網站建設-狐靈傳媒 整理
如沒特殊注明,文章均為狐靈科技原創,轉載請注明?? "網頁中禁止右鍵 查看 復制代碼
多一份免費策劃方案,總有益處。

請直接添加技術總監微信聯系咨詢

網站設計 品牌營銷

多一份參考,總有益處

聯系狐靈科技,免費獲得專屬《策劃方案》及報價

咨詢相關問題或預約面談,可以通過以下方式與我們聯系

業務熱線:15082661954 / 大客戶專線:15523356218