JSCode all of Brower 全局屏蔽網(wǎng)頁右鍵功能 具體實現(xiàn)
[javascript]
<script type="text/javascript">
function clickIE4(){
if (event.button==2){
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
return false;
}
}
}
function OnDeny(){
if(event.ctrlKey || event.keyCode==78 && event.ctrlKey || event.altKey || event.altKey && event.keyCode==115){
return false;
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
document.onkeydown=OnDeny();
}else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
document.onkeydown=OnDeny();
}
document.oncontextmenu=new Function("return false");
</script>
<script type="text/javascript">
function clickIE4(){
if (event.button==2){
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
return false;
}
}
}
function OnDeny(){
if(event.ctrlKey || event.keyCode==78 && event.ctrlKey || event.altKey || event.altKey && event.keyCode==115){
return false;
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
document.onkeydown=OnDeny();
}else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
document.onkeydown=OnDeny();
}
document.oncontextmenu=new Function("return false");
</script>
相關(guān)文章
前端開發(fā)之JS生成32位隨機(jī)數(shù)的方法舉例
最近有個需求,是需要生成32位長度的隨機(jī)數(shù),下面這篇文章主要給大家介紹了關(guān)于前端開發(fā)之JS生成32位隨機(jī)數(shù)的相關(guān)資料,文中通過實例代碼介紹的非常詳細(xì),需要的朋友可以參考下2023-01-01
利用javascript打開模態(tài)對話框(示例代碼)
本篇文章主要是對利用javascript打開模態(tài)對話框的示例代碼進(jìn)行了介紹,需要的朋友可以過來參考下,希望對大家有所幫助2014-01-01
Echarts讀取動態(tài)數(shù)據(jù)完整代碼
這篇文章主要給大家介紹了關(guān)于Echarts讀取動態(tài)數(shù)據(jù)的相關(guān)資料,使用Echarts畫圖時,數(shù)據(jù)一般不是靜態(tài)寫死的,而是通過后端接口動態(tài)獲取的,需要的朋友可以參考下2023-10-10
微信小程序開發(fā)之map地圖組件定位并手動修改位置偏差
這篇文章主要介紹了微信小程序開發(fā)之map地圖組件,定位,并手動修改位置偏差,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價值,需要的朋友可以參考下2019-08-08
Three.js利用性能插件stats實現(xiàn)性能監(jiān)聽的方法
Three.js 是一款運行在瀏覽器中的 3D 引擎,你可以用它創(chuàng)建各種三維場景,而下面這篇文章主要給大家介紹了關(guān)于Three.js如何利用性能插件stats實現(xiàn)性能監(jiān)聽的相關(guān)資料,需要的朋友可以參考借鑒,下面來一起學(xué)習(xí)學(xué)習(xí)吧。2017-09-09

