zoukankan      html  css  js  c++  java
  • 局域/整体禁用鼠标右键

    一:局域性禁用鼠标右键

    onpaste="alert('此处可调用模特弹窗');return false"

    二:整个页面禁用鼠标右键

    function click(e)
    {
    if (document.all)
    {
    if (event.button==1||event.button==2||event.button==3)
    {
    oncontextmenu='return false';
    }
    }
    if (document.layers)
    {
    if (e.which == 3)
    {
    oncontextmenu='return false';
    }
    }
    }
    if (document.layers)
    {
    document.captureEvents(Event.MOUSEDOWN);
    }
    document.onmousedown=click;
    document.oncontextmenu = new Function("return false;")
    var trxdyel=true
    var hotkey=17 /* hotkey即为热键的键值,是ASII码,这里99代表c键 */
    if (document.layers)
    document.captureEvents(Event.KEYDOWN)
    function gogo(e)
    {
    if (document.layers)
    {
    if (e.which==hotkey && trxdyel)
    {
    alert('操作错误.或许是您按错键了!');
    }
    }
    else if (document.all)
    {
    if (event.keyCode==hotkey&&trxdyel){ alert('操作错误.或许是您按错键了!'); }}
    }
    document.onkeydown=gogo

    var pass = {
            doc:function(id){
                return document.getElementById(id);
            },
    
            p:function(){
                pass.doc("password").style.backgroundColor = "#eeeef0";
            }
        };
  • 相关阅读:
    maven安装和配置
    maven的安装和配置
    mac上pydev
    Android自动化----adb shell,appium,uiautomator2
    Django
    centos操作---搭建环境 安装python
    Linux系统centos中sudo命令不能用----提升权限
    python---numpy
    python-socket
    Le x820 的刷机记录
  • 原文地址:https://www.cnblogs.com/lhl-shubiao/p/6692990.html
Copyright © 2011-2022 走看看