oncontextmenu="window.event.returnValue=false" style="overflow-y: hidden; overflow-x: hidden"ajs9 leftmargin="0" topmargin="0"

<body oncontextmenu="return false"></body>

<!--禁止网页另存为: -->

<noscript><iframe 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>

1. oncontextmenu="window.event.returnvalue=false" 将彻底屏蔽鼠标右键

<table border oncontextmenu=return(false)><td>no</table> 可用于Table

2. <body onselectstart="return false"> 取消选取、防止复制

3. onpaste="return false" 不准粘贴

4. oncopy="return false;" oncut="return false;" 防止复制

5. <link rel="Shortcut Icon" href="favicon.ico"> IE地址栏前换成自己的图标

6. <link rel="Bookmark" href="favicon.ico"> 可以在收藏夹中显示出你的图标

7. <input style="ime-mode:-Disabled"> 关闭输入法

8. 永远都会带着框架

<script language="javascript"><!--

if (window == top)top.location.href = "frames.htm"; //frames.htm为框架网页

// --></script>

9. 防止被人frame

<SCRIPT LANGUAGE=javascript><!--

if (top.location != self.location)top.location=self.location;

// --></SCRIPT>

11. <input type=button value=查看网页源代码

onclick="window.location = `view-source:`+ http://www.tonightdream.com/`";>

12.删除时确认

<a href=`javascript:if(confirm("确实要删除吗?"location="boos.asp?&areyou=删除&page=1"`>删除</a>

13. 取得控件的绝对位置

//javascript

<script language="javascript">

function getIE(E){

var t=e.offsetTop;

var l=e.offsetLeft;

while(e=e.offsetParent){

t+=e.offsetTop;

l+=e.offsetLeft;

<!--右键开始-->

<script language="JavaScript">

<!--

if (window.Event)

document.captureEvents(Event.MOUSEUP);

function nocontextmenu()

{

event.cancelBubble = true

event.returnValue = false;

return false;

}

function norightclick(e)

{

if (window.Event)

{

if (e.which == 2 || e.which == 3)

return false;

}

else

if (event.button == 2 || event.button == 3)

{

event.cancelBubble = true

event.returnValue = false;

return false;

}

}

document.oncontextmenu = nocontextmenu; // for IE5+

document.onmousedown = norightclick; // for all others

//-->

</script>

<!-- 禁止选择文本: -->

<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 language="javascript" type="text/javascript">

<!--

function key(){

if(event.shiftKey){

window.close();}

//禁止shift

if(event.altKey){

window.close();}

//禁止alt

if(event.ctrlKey){

window.close();}

//禁止ctrl

return false;}

//document.onkeydown=key;

if (window.Event)

document.captureEvents(Event.MOUSEUP);

//swordmaple javascript article.

//from www.jx165.com

function nocontextmenu(){

event.cancelBubble = true

event.returnValue = false;

return false;}

function norightclick(e){

if (window.Event){

if (e.which == 2 || e.which == 3)

return false;}

else

if (event.button == 2 || event.button == 3){

event.cancelBubble = true

event.returnValue = false;

return false;}

}

//禁止右键

document.oncontextmenu = nocontextmenu; // for IE5+

document.onmousedown = norightclick; // for all others

//-->

</script>

JS 禁用鼠标右键的更多相关文章

  1. HTML,JS禁止鼠标右键、禁止全选、复制、粘贴的方法

    禁止鼠标右键.禁止全选.复制.粘贴: oncontextmenu事件禁用右键菜单: js代码: document.oncontextmenu = function(){ event.returnVal ...

  2. 遇到Web页面禁用鼠标右键操作时,该如何解禁?

    在使用Selenium做Web UI自动化测试过程中,经常需要鼠标右击Web页面检查DOM节点,用于获取Web元素的定位信息.一般情况下,绝大多数页面都是能够响应鼠标右击操作的.但出于某些目的,有些W ...

  3. JQuery中判断checkbox是否选中与禁用鼠标右键

    if ($("#wds_checkbox").attr("checked")) { flag = ; } else { flag = ; } 禁用鼠标右键 // ...

  4. js的鼠标右键简单菜单

    实现点击鼠标右键时出来菜单代码如下: 主要运用oncontextmenu事件,oncontextmenu 事件在元素中用户右击鼠标时触发并打开上下文菜单. <!DOCTYPE html> ...

  5. js自定义鼠标右键菜单

    document.oncontextmenu = function(e) { return false; } document.onmousedown = function(e) { switch(e ...

  6. JS屏蔽鼠标右键

    //方法1: function stop() {    return false;}document.oncontextmenu = stop;//方法2: window.document.oncon ...

  7. js实现鼠标右键自定义菜单(弹出层),并与树形菜单(TreeView)、iframe合用(兼容IE、Firefox、Chrome)

    <table class="oa-el-panel-tree"> <tr> <td style="vertical-align: top; ...

  8. html body标签的几个属性 禁用鼠标右键,禁用鼠标选中文字等

    <body oncontextmenu='return false' ondragstart='return false' onselectstart ='return false' onsel ...

  9. JS禁止鼠标右键、禁止全选、复制、粘贴的方法(所谓的防盗功能)

    简述:一个防君子不防小人的鸡肋的功能,针对小白还行. 代码如下: <script> //都能支持 document.oncontextmenu = function (e) { retur ...

随机推荐

  1. 程序员修神之路--🤠分布式高并发下Actor模型如此优秀🤠

    写在开始 一般来说有两种策略用来在并发线程中进行通信:共享数据和消息传递.使用共享数据方式的并发编程面临的最大的一个问题就是数据条件竞争.处理各种锁的问题是让人十分头痛的一件事. 传统多数流行的语言并 ...

  2. (hdu)4858 项目管理 (vector)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4858 Problem Description 我们建造了一个大项目!这个项目有n个节点,用很多边连接起 ...

  3. Unit 4.css的导入方式和选择器

    一.什么是css CSS是指层叠样式表(Cascading Style Sheets),样式定义如何显示HTML元素,样式通常又会存在于样式表中.也就是说把HTML元素的样式都统一收集起来写在一个地方 ...

  4. safari打开的页面数字识别变为蓝色

    今天网页碰到一个很怪异的问题:app打开的一个网页样式是好的,但通过safari打开后数字的颜色变为蓝色,并且还变得可点击了! 原来safari总会把长串数字识别为电话号码,文字变成蓝色,点击还会弹出 ...

  5. Shell命令-线上查询及帮助之man、help

    线上查询及帮助 - man.help 1.man:获取命令的帮助信息 man命令的简单介绍 man命令是Linux系统中最核心的命令之一 ,因为通过它可以查看其它Linux命令的使用信息.当然了 ,m ...

  6. EntityFramework Core笔记:表结构及数据基本操作(2)

    1. 表结构操作 1.1 表名 Data Annotations: using System.ComponentModel.DataAnnotations.Schema; [Table("R ...

  7. Python——collections模块(扩展数据类型)

    1.namedtuple:利用坐标.空间坐标,扑克牌等指定空间位置 # namedtuple('名字',[list列表属性])from collections import namedtuple Po ...

  8. Azure - Create your first function using Visual Studio

    Azure Functions lets you execute your code in a serverless environment without having to first creat ...

  9. [模板] 二分图博弈 && BZOJ2463:[中山市选2009]谁能赢呢?

    二分图博弈 from BZOJ 1443 游戏(二分图博弈) - free-loop - 博客园 定义 1.博弈者人数为两人,双方轮流进行决策. 2.博弈状态(对应点)可分为两类(状态空间可分为两个集 ...

  10. Tomcat 部署java web项目直接ip地址访问项目

    正常情况下,在访问在Tomcat中部署的项目是 http://localhost:8080/demo 方式 其中,IP,端口,项目名(Demo)都是必须的. 那么,怎么样才能通过 http://loc ...