Iefans,靠谱的软件下载站

首页 最新文章 最新安卓 最新苹果 浏览器 IE教程 在线图片编辑 最新软件 最新游戏

当前位置: IEfans / IE专区 / IE动态/ 禁止IE用右键的JS代码

禁止IE用右键的JS代码

编辑:秩名2023-06-28 15:30:01

复制代码 代码如下:
!--禁止网页右键: --

document.body.oncontextmenu=function rightClick(){ window.event.returnValue= false;}

!--禁止网页另存为: --
noscriptiframe src=*.html/iframe/noscript

!-- 禁止选择文本: --
script type="text/javascript"

var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
/script

!-- 禁用右键: --
script
function stop(){
return false;
}
document.oncontextmenu=stop;
/script

您可能感兴趣的文章:

  • javascript实现禁止右键和F12查看源代码
  • js禁止页面刷新禁止用F5键刷新禁止右键的示例代码
  • js禁止页面复制功能禁用页面右键菜单示例代码
  • JS实现禁止鼠标右键的功能
  • js禁止页面使用右键(简单示例代码)
  • JavaScript代码实现禁止右键、禁选择、禁粘贴、禁shift、禁ctrl、禁alt
  • JS禁止浏览器右键查看元素或按F12审查元素自动关闭页面示例代码
返回旧版Copyright © 1998-2023 www.iefans.net All Rights Reserved 沪ICP备17019769号-18 意见反馈