jQuery禁用快捷键例如禁用F5刷新 禁用右键菜单等
禁用鼠标右键菜单栏
$("body").bind("contextmenu", function(event) {
return false;
});
禁用快捷键
$("body").bind("keydown",function(e){
e=window.event||e;
//禁止空格键翻页
if(event.keyCode==32){
return false;
}
//屏蔽F5刷新键
if(event.keyCode==116){
e.keyCode = 0; //IE下需要设置为keyCode为false
return false;
}
//屏蔽 Alt+ 方向键 ←
//屏蔽 Alt+ 方向键 →
if ((event.altKey)&&((event.keyCode==37)||(event.keyCode==39)))
{
event.returnValue=false;
return false;
}
//屏蔽退格删除键
if(event.keyCode==8){
return false;
}
//屏蔽ctrl+R
if((event.ctrlKey) && (event.keyCode==82)){
e.keyCode = 0;
return false;
}
});
jQuery禁用快捷键例如禁用F5刷新 禁用右键菜单等的更多相关文章
- jQuery 中屏蔽浏览器的F5刷新功能
//支持ie(6,7,8),火狐,谷歌,opera,等主流浏览器 $(document).keydown(function(e){ e=window.event||e; if(e.keyCode==1 ...
- EasyUI 表格点击右键添加或刷新 绑定右键菜单
例1 在HTML页面中设置一个隐藏的菜单(前提是已经使用封装的Easyui) 代码: <div id="contextMenu_jygl" class="easyu ...
- jquery禁用右键单击功能屏蔽F5刷新
1.禁用右键单击功能$(document).ready(function() { $(document).bind("contextmenu",function(e) { aler ...
- jquery禁用右键单击、F5刷新
1.禁用右键单击功能 $(document).ready(function() { $(document).bind("contextmenu",function(e) { ale ...
- WebBrowser控件禁用超链接转向、脚本错误提示、默认右键菜单和快捷键
原文:WebBrowser控件禁用超链接转向.脚本错误提示.默认右键菜单和快捷键 WebBrowser控件禁用超链接转向.脚本错误提示.默认右键菜单和快捷键从 VS2005开始,VS自带的 WebBr ...
- js禁止页面复制 禁用页面右键菜单的代码
js实现禁止页面复制功能.禁用页面右键菜单等功能. <body oncontextmenu="return false">禁用网页右键菜单,但是仍然可以使用快捷键复制 ...
- 禁止页面复制功能 js禁止复制 禁用页面右键菜单
<body oncontextmenu="return false">禁用网页右键菜单,但是仍然可以使用快捷键复制. js代码禁用复制功能: <script t ...
- ASP.NET Boilerplate 学习 AspNet Core2 浏览器缓存使用 c#基础,单线程,跨线程访问和线程带参数 wpf 禁用启用webbroswer右键菜单 EF Core 2.0使用MsSql/MySql实现DB First和Code First ASP.NET Core部署到Windows IIS QRCode.js:使用 JavaScript 生成
ASP.NET Boilerplate 学习 1.在http://www.aspnetboilerplate.com/Templates 网站下载ABP模版 2.解压后打开解决方案,解决方案目录: ...
- 自定义右键菜单,禁用浏览器自带的右键菜单[右键菜单实现--Demo]
许多从事Web开发的会发现有些事,我们需要禁用浏览器本事自带的右键菜单,而实现自定义的右键菜单下面我们也来实现一个自定义的右键菜单 首先来创建JSP页面 <%@ page language=&q ...
随机推荐
- python jenkins-api,jira crowd. email-servers
jenkins user authentication: http://stackoverflow.com/questions/15411208/authenticate-jenkins-users ...
- 源码网站(msdn.itellyou.cn) good
verysource 100万源码http://www.verysource.com/category/delphi-vcl/ MSDN DOWNLOADhttp://msdn.itellyou.cn ...
- 常见的java类
String System StringBuilder Thread Math ArrayList LinkedList HashMap HashSet Scanner Calendar Date F ...
- mac eclipse 添加pydev插件 步骤
前提:eclipse环境可以正常使用 python环境可以正常使用 1.下载pydev(http://www.pydev.org/)
- bugs
2016-09-04 10:24:14.503 Scgl[1035:341694] You've implemented -[<UIApplicationDelegate> applica ...
- const
const int i = 20; int const i = 20; 这两个语句是完全相同的:const与int哪个写在前面都不影响语义. 所以: const int *p; int const ...
- 让div支持placeholder属性/模拟输入框的placeholder属性
实现方式:css div:empty:before{ content: attr(placeholder); color:#bbb;}div:focus:before{ content:none; }
- Programming paradigms
https://en.wikipedia.org/wiki/Aspect-oriented_programming Action Agent-oriented Array-oriented Autom ...
- linux查看某个进程内存占用情况以及/proc/pid/status解释
以nginx 为例1.toptop -b -n 1 |grep nginx|awk '{print "VIRT:"$5,"RES:"$6,"cpu:& ...
- Leetcode: Circular Array Loop
You are given an array of positive and negative integers. If a number n at an index is positive, the ...