zoukankan      html  css  js  c++  java
  • js实现 弹出div 并且使本页变淡,不可编辑

    // JScript 文件

           function sAlert(str)
            {
            var msgw,msgh,bordercolor;
            msgw=400;//提示窗口的宽度
            msgh=100;//提示窗口的高度
            titleheight=25 //提示窗口标题高度
            bordercolor="#c51100";//提示窗口的边框颜色
            titlecolor="#c51100";//提示窗口的标题颜色
           
            var sWidth,sHeight;
            sWidth=screen.width;//屏幕宽
            sHeight=screen.height;//屏幕高

            var bgObj=document.createElement("div");
            bgObj.setAttribute('id','bgDiv');
            bgObj.style.position="absolute";
            bgObj.style.top="0";
            bgObj.style.background="#cccccc";
            bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75)";
            bgObj.style.opacity="0.6";
            bgObj.style.left="0";
            bgObj.style.width=sWidth + "px";
            bgObj.style.height=sHeight + "px";
            bgObj.style.zIndex = "100";
            document.body.appendChild(bgObj);
            var msgObj=document.getElementById("div1");
            msgObj.style.display = "block";
            }
           
           
            function guanbi()
            {
               var bgObj=document.getElementById("bgDiv");
               document.body.removeChild(bgObj);
              
               var msgObj=document.getElementById("div1");
               msgObj.style.display = "none";
            }

  • 相关阅读:
    继承与 接口
    数组
    字符串加密
    类与对象
    java 方法学习
    课堂练习
    第一次课堂任务记录。整形数字相加合输出
    《大道至简》第二章 读后感
    大道至简第二章
    大道至简第一章
  • 原文地址:https://www.cnblogs.com/tongdengquan/p/6090625.html
Copyright © 2011-2022 走看看