禁止 遮蔽 滑鼠右鍵

2022-04-06 04:55:56 字數 1707 閱讀 3574

<

body

oncontextmenu

="return false"

onselectstart

="return false"

ondragstart

="return false"

onbeforecopy

="return false"

onmouseup

=document.selection.empty()

oncopy

=document.selection.empty()

onselect

=document.selection.empty()

>

body

>

onselectstart="return false" 禁止選擇,ondragstart="return false"禁止拖放,oncopy=document.selection.empty() 禁止拷貝。

禁止儲存:

<

noscript

><

iframe

src="*.htm"

>

iframe

>

noscript

>

,放在head裡面。

禁止貼上:

<

input

type

=text

onpaste

="return false"

>

關閉輸入法:

<

input

style

="ime-mode:disabled"

>

遮蔽滑鼠右鍵:

function document.oncontextmenu()

遮蔽f1幫助:

function window.onhelp()

遮蔽其他鍵

function document.onkeydown()

if ((event.keycode==8) || //遮蔽退格刪除鍵

(event.keycode==116)|| //遮蔽 f5 重新整理鍵

(event.ctrlkey && event.keycode==82))

if (event.keycode==122) //遮蔽f11

if (event.ctrlkey && event.keycode==78) event.returnvalue=false; //遮蔽 ctrl+n

if (event.shiftkey && event.keycode==121)event.returnvalue=false; //遮蔽 shift+f10

if (window.event.srcelement.tagname == "a" && window.event.shiftkey)

window.event.returnvalue = false; //遮蔽 shift 加滑鼠左鍵新開一網頁

if ((window.event.altkey)&&(window.event.keycode==115)) //遮蔽alt+f4

}遮蔽列印:

<

style

>

@media print

}style

>

禁止滑鼠右鍵

禁止滑鼠右鍵 nc ntextmenu return false 禁止選擇 onselectstart return false 禁止拖放 ndragstart return false 禁止拷貝 nc py document.selection.empty 禁止複製 oncopy return f...

javascript 禁止滑鼠右鍵

nc ntextmenu return false onselectstart return false ndragstart return false onbeforecopy return false nm useup document.selection.empty nc py documen...

網頁中遮蔽滑鼠右鍵

在html網頁中加入幾行簡單的 可以禁止他人使用滑鼠右鍵和 另存為 命令。一 遮蔽滑鼠右鍵 把網頁的標籤修改為下面的 body oncontextmenu self.event.returnvalue false onselectstart return false 現在點選滑鼠右鍵就不會有任何反應...