zoukankan      html  css  js  c++  java
  • 兼容火狐,IE 的遮罩层

    脚本:

    /*添加全局禁用div*/
    function DisabledAll(value) {
        var my = document.createElement("div");
        document.body.appendChild(my);
        my.className = "layerGray";
        var ContentHeight = document.body.scrollHeight; //其它浏览器默认值
        if (navigator.userAgent.indexOf("Chrome") != -1)
            ContentHeight = document.body.clientHeight;
        if (navigator.userAgent.indexOf("Firefox") != -1)
            ContentHeight = document.body.offsetHeight+300;
        my.style.height = ContentHeight + 300 + 'px';
        my.innerHTML = value;
    }

     样式:
    /*整个页面变灰*/
    .layerGray { background-color: Gray; color: Red; position: absolute; z-index: 100; top: 0px; left: 0px; 100%; filter: alpha(opacity=70); -moz-opacity: 0.7; opacity: 0.7; } 

    测试:     <input type="button" value="test" onclick="DisabledAll('此页面已经禁用');" />

    联盟快卖 商人,生意人,待创业人士在此可以共赢互利 期待你的加入 群号:140809277
  • 相关阅读:
    MongoDB数据库新建数据库用户
    Grafana部署
    k8s ingress及ingress controller
    Rabbitmq如何安装插件
    RabbitMQ手册之rabbitmq-plugins
    RabbitMQ运行在Docker容器中
    K8S资源限制
    System类
    Runtime类
    StringBuffer类
  • 原文地址:https://www.cnblogs.com/yexinw/p/2226395.html
Copyright © 2011-2022 走看看