DHTML动态创建一个弹出遮罩层

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head>
  <script language="javascript">
   function showdialog()
   {
    var divmask=document.createElement("div");    
    divmask.style.cssText="position:absolute;left:0px;top:0px;width:100%;height:100%;z-index:4;background-color:yellow;filter:Alpha(opacity=80)";
    document.body.appendChild(divmask);
   }   
  </script>  
 </head>
 <body topmargin="0" leftmargin="0">
 <center>
    <button id="test" onclick="javascript:showdialog();">
    <br/>
    弹出层  
    <br/>
    </div>

 </center>
 </body>
</html>

posted @ 2010-01-20 03:04  Max Woods  阅读(360)  评论(0编辑  收藏  举报