• 不一样的Alert();


      1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
      2<html>
      3    <head>
      4        <title></title>
      5        <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
      6        <meta name="ProgId" content="VisualStudio.HTML">
      7        <meta name="Originator" content="Microsoft Visual Studio .NET 7.1">
      8        <script language="javascript" type="text/javascript">
      9
     10//Author:Daviv
     11//Blog:http://blog.163.com/jxdawei
     12//Date:2006-10-27
     13//Email:jxdawei@gmail.com
     14
     15            function sAlert(str){
     16            var msgw,msgh,bordercolor;
     17            msgw=400;//提示窗口的宽度
     18            msgh=100;//提示窗口的高度
     19            titleheight=25 //提示窗口标题高度
     20            bordercolor="#336699";//提示窗口的边框颜色
     21            titlecolor="#99CCFF";//提示窗口的标题颜色
     22            
     23            var sWidth,sHeight;
     24            sWidth=document.body.offsetWidth;
     25            sHeight=document.body.scrollHeight;
     26
     27            var bgObj=document.createElement("div");
     28            bgObj.setAttribute('id','bgDiv');
     29            bgObj.style.position="absolute";
     30            bgObj.style.top="0";
     31            bgObj.style.background="#777";
     32            bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";
     33            bgObj.style.opacity=0.6;
     34            bgObj.style.left="0";
     35            bgObj.style.width=sWidth + "px";
     36            bgObj.style.height=sHeight + "px";
     37            bgObj.style.zIndex = "10000";
     38            document.body.appendChild(bgObj);
     39            
     40            var msgObj=document.createElement("div")
     41            msgObj.setAttribute("id","msgDiv");
     42            msgObj.setAttribute("align","center");
     43            msgObj.style.background="white";
     44            msgObj.style.border="1px solid " + bordercolor;
     45            msgObj.style.position = "absolute";
     46            msgObj.style.left = "50%";
     47            msgObj.style.top = "50%";
     48            msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
     49            msgObj.style.marginLeft = "-225px" ;
     50            msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px";
     51            msgObj.style.width = msgw + "px";
     52            msgObj.style.height =msgh + "px";
     53            msgObj.style.textAlign = "center";
     54            msgObj.style.lineHeight ="25px";
     55            msgObj.style.zIndex = "10001";
     56   
     57           var title=document.createElement("h4");
     58           title.setAttribute("id","msgTitle");
     59           title.setAttribute("align","right");
     60           title.style.margin="0";
     61           title.style.padding="3px";
     62           title.style.background=bordercolor;
     63           title.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
     64           title.style.opacity="0.75";
     65           title.style.border="1px solid " + bordercolor;
     66           title.style.height="18px";
     67           title.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif";
     68           title.style.color="white";
     69           title.style.cursor="pointer";
     70          // title.innerHTML="关闭";
     71           title.onclick=function(){
     72               
     73                }

     74           document.body.appendChild(msgObj);
     75           document.getElementById("msgDiv").appendChild(title);
     76           var txt=document.createElement("p");
     77           txt.style.margin="1em 0"
     78           txt.setAttribute("id","msgTxt");
     79           txt.innerHTML=str;
     80          txt.innerHTML+=" <img src='loader.gif'>";
     81        
     82           document.getElementById("msgDiv").appendChild(txt);
     83           a(0);
     84           }

     85           function a(i)
     86        {
     87            if(i<50)
     88            {
     89            document.getElementById("bgDiv").style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+i+")"
     90                
     91                 i+=10;
     92                 setTimeout("a("+i+")",100);
     93            }

     94        }

     95        </script>
     96    </head>
     97    <body>
     98        <div onclick="sAlert('要打的字')">点击</div>
     99    </body>
    100</html>
    101
  • 相关阅读:
    git在iOS开发中的使用
    搜索联系人是去掉拼音中的空格
    xmPP(即时通讯)向远程服务器请求数据
    使用CFStringTransform进行汉字转拼音(可去掉声调)
    node的模块系统和commonJS规范的关系
    在centos7中通过使用yum安装mongoDB
    vue跨组件通信,简易状态管理的使用
    Linux(centos7) 常用命令
    前端打包后, 路由模式为history时,用express测试服务端能否正常解析路由路径
    几个文件目录树生成工具tree,treer,tree-cli,tree-node-cli的使用配置和对比
  • 原文地址:https://www.cnblogs.com/suneryong/p/764160.html
Copyright © 2020-2023  润新知