js 屏蔽浏览器右键菜单】的更多相关文章

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-…
<script type="text/javascript"> function doNothing(){ window.event.returnValue=false; return false; } </script> <body oncontextmenu="doNothing()"> 有时候我们在某些网站上不想用户点击右键进行复制等操作 在body里面处理下就好了 移动端长按会复制等选项可以使用下述的代码屏蔽这个功能,将下…
<script type="text/javascript"> function doNothing(){ window.event.returnValue=false; return false; } </script> <body oncontextmenu="doNothing()"> 有时候我们在某些网站上不想用户点击右键进行复制等操作 在body里面处理下就好了 移动端长按会复制等选项可以使用下述的代码屏蔽这个功能,将下…
<script language="javascript"> //禁止按键F5 document.onkeydown = function(e){ e = window.event || e; var keycode = e.keyCode || e.which; if( keycode = 116){ if(window.event){// ie try{e.keyCode = 0;}catch(e){} e.returnValue = false; }else{// f…
document.oncontextmenu = function(){return false;} 参考链接:js 屏蔽浏览器事件汇总…
//一.js屏蔽浏览器(IE和FireFox)的刷新功能 document.onkeydown=function() { if ((window.event.keyCode==116)|| //屏蔽 F5 (window.event.keyCode==122)|| //屏蔽 F11 (window.event.shiftKey && window.event.keyCode==121) //shift+F10 ) { window.event.keyCode=0; window.event…
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-…
javascript自定义浏览器右键菜单   在书上看到document对象还有一个contextmenu事件,但是不知为什么w3school中找不到这个耶... 利用这个特性写了个浏览器的右键菜单,感觉挺不错,呵呵... HTML部分(在<body></body>之间插入以下HTML): 查看代码 <div id="menu"> <ul> <li><a href="#">contextmenu…
js去掉浏览器右键点击默认事件 1.阻止整个页面所有的右击事件 document.oncontextmenu = function(){ return false;} 2.特定的区域/元素 document.getElementById("test").oncontextmenu = function(e){ return false;} 3.去掉以后给需要的区块加特定的事件 js: document.getElementById("test").onmousedo…
基于Window消息实现 class TextBoxExt:TextBox { private const int WM_RBUTTONDOWN = 0x0204; private const int WM_CHAR = 0x0102; protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_RBUTTONDOWN: return;//屏蔽默认右键菜单 break; case WM_CHAR: int n…
JS 百度地图-右键菜单 /*-----------------标注右键删除-------------------------*/ var markerMenu = new BMap.ContextMenu(); markerMenu.addItem(new BMap.MenuItem('删除标注 ', function () { map.removeOverlay(marker); })) marker.addContextMenu(markerMenu);…
2015-03-02 更新文章,由于需求修改,更改了flexpaper插件,故增加第9.10.11小节,下载代码时请注意. 先废话几句.最近用到文档在线浏览功能,之前用的是print2flash(一个工具,文档直接转flash,自带翻页搜索等一系列功能),由于无法与js进行交互,所以改用flexpaper. 由于之前没接触过Flex,了解不多,所以文章难免有不合适的地方.希望各位给予指正. 首先感谢ajava.org的mark,一系列文章有很多的帮助,少走很多弯路. 开发工具:1.Adobe F…
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>javascript右键菜单</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>…
http://www.cnblogs.com/del/archive/2008/10/25/1319318.html TApplicationEvents.OnMessage 的第二个参数 Handled 如果是 True, 表示消息已经处理过了, 到此为止. unit Unit1; interface uses   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,   Dialogs, AppE…
要做一个IE右键浏览器插件,得3步走. 第一,在IE右键菜单上添加自定义菜单名称,是通过注册表实现的,如下: string regkey = @"Software\Microsoft\Internet Explorer\MenuExt\KnowledgeSave"; string scriptPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"getcurrenturl.htm"); Regist…
document.oncontextmenu = function(e) { return false; } document.onmousedown = function(e) { switch(e.button) { case 0: console.log("鼠标左键") break; case 1: console.log("鼠标中间"); break; case 2: console.log("鼠标右键"); break; default…
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>自定义右键菜单</title> <style> body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{ m…
//js 屏蔽 window.document.oncontextmenu = function () { event.returnValue = false; }//屏蔽鼠标右键 window.document.onselectstart = function () { event.returnValue = false; }//屏蔽鼠标选择 window.window.onhelp = function (){return false } //屏蔽F1帮助 window.document.o…
今天用到spreadsheetGear 插件,然后右键有插件自己的菜单.都是英文的,而且还能打开新的窗体.嵌到程序里面,不太合适,所以着手屏蔽. 刚开始用的Mouse_up,虽然能捕获事件,但是没有KeyPress事件的Handled属性. 百度之,发现相对简单的方法. 1.先让窗体类继承IMessageFilter接口2.在构造函数中添加:Application.AddMessageFilter(this);3.在代码中加入: public bool PreFilterMessage(ref…
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <script> //oEvent.cancelBubble=true;//取消事件冒泡 // 如果你想实现按下就连续动,可以onkeydown后,起一个 var it =…
建立Installer安装类,如图: 代码如下: using Microsoft.Win32; using ResourceShare.UserClient.Common; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Configuration.Install; using System.Diagnostics…
(如果本页面没有自动下载,请点这里下载) IE浏览器分享工具安装步骤:1.发起下载请求后,屏幕上会弹出文件保存对话框,将文件保存到您电脑本地的磁盘中 2.双击刚才下载的安装文件,将JiaThis_ShareTools.reg分享工具加入注册表,当出现提示时,请选择"是". 3.打开执行文件,选择“确定”.JiaThis分享工具为绿色软件,极易安装和卸载,不会给系统带来任何危害,请您放心使用. 4.安装完毕后系统会自定提示您“JiaThis_ShareTools.reg中包含的项和值已成…
我也是第一次接触这个功能,只需一行代码即可搞定,直译过来就是“屏蔽上下文菜单”,特此记录一下吧. document.oncontextmenu = () => false;…
//方法1: function stop() {    return false;}document.oncontextmenu = stop;//方法2: window.document.oncontextmenu = function(){  //alert('请不要点击鼠标右键!'); return false; }…
<script type="text/javascript">function stops(){ return false;}document.oncontextmenu=stops;</script>…
我们知道通过oncontextmenu事件可以屏蔽浏览器右键菜单 $('img').on("contextmenu",function(E){E.preventDefault();E.stopPropagation();E.returnValue=false; return false;}) 可是这一招在移动设备的浏览器中却失灵了,移动设备的浏览器的contextmenu是通过长按事件触发的,我想正是因为这和原因造成的上述手段失灵. 经调试发现,屏蔽touchstart事件可以解决:…
效果: 代码: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script src="test/datatables/jquery-1.10.2.js"></script> <style> *{ padding:0; margin:0; } .button{ widt…
我们在网页中很多都有右键菜单的功能,一般点击右键显示的是浏览器默认的菜单选项,那么我们直接如何通过css+js实现html的右键菜单呢?这篇文章将讲解html鼠标自定义右键菜单的实现原理和实现代码. 实现原理 在HTML中基本上每个对象都有一个oncontextmenu事件,这个事件就是鼠标的右键单击事件(onclick事件是鼠标的左键单击事件),我们可以监听oncontextmenu事件,阻止默认的浏览器右键菜单e.preventDefault();然后显示我们想要显示的菜单信息,当我们单击其…
右键菜单 思路 1.遮蔽原来的默认右键菜单 2.新建右键菜单跟随鼠标移动 3.注意边界处的位置变化 4.自定义右键内容的具体效果 具体 这样的事件涉及到有关contextmenu事件,阻止默认事件,获取鼠标点击位置,涉及到offsetWidth等等,具体展示 offsetWidth:元素在水平方向占据的空间,只包括width padding border offsetHeight:元素在垂直方向占据的空间,只包括height padding border offsetTop:偏移量,相对于已定位…
jquery中使用contextmenu事件,如果返回true,则允许右键菜单:如果返回false,则禁止右键菜单 导入文件 <script type="text/javascript" src="jquery.min.js"></script> js方法 <script> $(function(){ //contextmenu事件返回false则屏蔽鼠标右键菜单 $(document).bind("contextmen…