本文介绍了如何禁用Ctrl + a使用JavaScript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< script type =text / javascript>
函数mischandler(){
return false;
}
函数mousehandler(e){
var myevent =(isNS)? e:事件;
var eventbutton =(isNS)? myevent.which:myevent.button;
if((eventbutton == 2)||(eventbutton == 3))return false;
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
var isCtrl = false;
document.onkeyup = function(e)
{
if(e.which == 17)
isCtrl = false;
document.onkeydown = function(e)
{
if(e.which == 17)
isCtrl = true;
if((e.which == 85)||(e.which == 67)&& isCtrl == true)
{
// alert('Keyboard shortcuts are凉!');
返回false;
}
}
< / script>
大家好,我使用代码禁用右键单击,并且 中的kbd> + 和 + 下面的代码。任何帮助都会很棒。
感谢,
vicky
解决方案
检查ctrl + a,ctrl + A,ctrl + c,ctrl + C,ctrl + u,ctrl + U下面的代码。 pre> < script type =text / javascript>
var isNS =(navigator.appName ==Netscape)? 1:0;
if(navigator.appName ==Netscape)document.captureEvents(Event.MOUSEDOWN || Event.MOUSEUP);
函数mischandler(){
return false;
}
函数mousehandler(e){
var myevent =(isNS)? e:事件;
var eventbutton =(isNS)? myevent.which:myevent.button;
if((eventbutton == 2)||(eventbutton == 3))return false;
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
var isCtrl = false;
document.onkeyup = function(e)
{
if(e.which == 17)
isCtrl = false;
document.onkeydown = function(e)
{
if(e.which == 17)
isCtrl = true;如果(((其中== 95)||(e.which == 117)||(e.which == 65)||(例如== 97)||(e。其中== 67)||(e.which == 99))&& isCtrl == true)
{
// alert('Keyboard shortcuts are cool!');
返回false;
}
}
您可以从下面的链接中获得钥匙的价值
享受...! :)
<script type="text/javascript">
function mischandler(){
return false;
}
function mousehandler(e){
var myevent = (isNS) ? e : event;
var eventbutton = (isNS) ? myevent.which : myevent.button;
if((eventbutton==2)||(eventbutton==3)) return false;
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
var isCtrl = false;
document.onkeyup=function(e)
{
if(e.which == 17)
isCtrl=false;
}
document.onkeydown=function(e)
{
if(e.which == 17)
isCtrl=true;
if((e.which == 85) || (e.which == 67) && isCtrl == true)
{
// alert(‘Keyboard shortcuts are cool!’);
return false;
}
}
</script>
Hi all , I using the code to disable the right click and also the + and + how to disable the in the following code. Any help would be great.
Thanks,vicky
解决方案
FInd the below code for detect ctrl + a,ctrl + A,ctrl + c,ctrl + C, ctrl + u,ctrl + U with your code editing.
<script type="text/javascript">
var isNS = (navigator.appName == "Netscape") ? 1 : 0;
if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
function mischandler(){
return false;
}
function mousehandler(e){
var myevent = (isNS) ? e : event;
var eventbutton = (isNS) ? myevent.which : myevent.button;
if((eventbutton==2)||(eventbutton==3)) return false;
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
var isCtrl = false;
document.onkeyup=function(e)
{
if(e.which == 17)
isCtrl=false;
}
document.onkeydown=function(e)
{
if(e.which == 17)
isCtrl=true;
if(((e.which == 85) || (e.which == 117) || (e.which == 65) || (e.which == 97) || (e.which == 67) || (e.which == 99)) && isCtrl == true)
{
// alert(‘Keyboard shortcuts are cool!’);
return false;
}
}
you can get value for key from below link
http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00000520.htmlEnjoy...!! :)
这篇关于如何禁用Ctrl + a使用JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!