给一个类似的效果你参考吧:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<STYLE>
   #login{
     position: relative;
     display: none;
         top: 20px;
         left: 30px;
         background-color: #ffffff;
         text-align: center;
         border: solid 1px;
         padding: 10px;
         z-index: 1;
   }
  
</STYLE>
<script  type="text/javascript">
var W = screen.width;//取得屏幕分辨率宽度
var H = screen.height;//取得屏幕分辨率高度function M(id){
    return document.getElementById(id);//用M()方法代替document.getElementById(id)
}
function MC(t){
   return document.createElement(t);//用MC()方法代替document.createElement(t)
};
//判断浏览器是否为IE
function isIE(){
      return (document.all && window.ActiveXObject && !window.opera) ? true : false;

//取得页面的高宽
function getBodySize(){
   var bodySize = [];
   with(document.documentElement) {
    bodySize[0] = (scrollWidth>clientWidth)?scrollWidth:clientWidth;//如果滚动条的宽度大于页面的宽度,取得滚动条的宽度,否则取页面宽度
    bodySize[1] = (scrollHeight>clientHeight)?scrollHeight:clientHeight;//如果滚动条的高度大于页面的高度,取得滚动条的高度,否则取高度
   }
   return bodySize;
}
//创建遮盖层
function popCoverDiv(){
   if (M("cover_div")) {
   //如果存在遮盖层,则让其显示 
    M("cover_div").style.display = 'block';
   } else {
   //否则创建遮盖层
    var coverDiv = MC('div');
    document.body.appendChild(coverDiv);
    coverDiv.id = 'cover_div';
    with(coverDiv.style) {
     position = 'absolute';
     background = '#CCCCCC';
     left = '0px';
     top = '0px';
     var bodySize = getBodySize();
     width = bodySize[0] + 'px'
     height = bodySize[1] + 'px';
     zIndex = 0;
     if (isIE()) {
      filter = "Alpha(Opacity=60)";//IE逆境
     } else {
      opacity = 0.6;
     }
    }
   }
}
//让登陆层显示为块 
    function showLogin()
    {
                var login=M("login");
            login.style.display = "block";
        }//设置DIV层的样式
function change(){
          var login = M("login");
      login.style.position = "absolute";
      login.style.border = "1px solid #CCCCCC";
      login.style.background ="#F6F6F6";
      var i=0;
          var bodySize = getBodySize();
      login.style.left = (bodySize[0]-i*i*4)/2+"px";
      login.style.top = (bodySize[1]/2-100-i*i)+"px";
      login.style.width =      i*i*4 + "px";
      login.style.height = i*i*1.5 + "px";
     
      popChange(i);
}
//让DIV层大小循环增大
function popChange(i){
      var login = M("login");
          var bodySize = getBodySize();
      login.style.left = (bodySize[0]-i*i*4)/2+"px";
      login.style.top = (bodySize[1]/2-100-i*i)+"px";
      login.style.width =      i*i*4 + "px";
      login.style.height = i*i*1.5+ "px";
      if(i<=10){
           i++;
           setTimeout("popChange("+i+")",10);//设置超时10毫秒
      }
}
//打开DIV层
function open()
{
        change();
        showLogin();
        popCoverDiv()
        void(0);//不进行任何操作,如:<a href="#">aaa</a>
}
//关闭DIV层
function close(){
         M('login').style.display = 'none';
         M("cover_div").style.display = 'none';
        void(0);
}</script>
</head><body><a href="javascript:open();">登陆</a><div id="login">
  <span>用户登陆</span>
   <div id="panel">
   <lable>用户名:&nbsp;</lable><input type="text" size="20" />
   <lable>密码:&nbsp;</lable><input type="password" size="20">
   <input type="checkbox" /><lable>登陆</lable>
   </div>
   <input type="button" value="提交" />
         <a href="javascript:close();">关闭</a>  
</div>
</body>
</html>  

解决方案 »

  1.   

    楼上说的CSS怎么控制说明一下吧
      

  2.   

    这里有例子:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> 模拟日语等级报名网 </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="梁超">
    <style type='text/css'>
    *{
    padding:0px;margin:0px;
    }
    body{
    font-size:12px;
    }
    #test{
    position:absolute;width:751px;height:246px;left:50%;top:50%;margin:-123px 0 0 -375px;background:url(http://www.52hai.com/2005/uploads/200803/21_082858_2.jpg);
    }
    #test_left{
    float:left;width:459px;
    }
    #test_right{
    float:right;width:292px; padding:51px 0px 0px 0px;
    }
    #test_right ul{
    list-style:none;
    }
    #test_right ul li{
    background:url(http://www.52hai.com/2005/uploads/200803/21_083226_5.gif) no-repeat left center; padding:10px 0px 0px 4px; height:27px;
    }
    #test_right input{
    height:17px;border:none;font-size:12px;
    }
    .test_buttom{
    line-height:28px;text-align:center;
    }
    .test_buttom a:link, .test_buttom a:visited, .test_buttom a:active {
    float:left;display:block;width:63px;background: url(http://www.52hai.com/2005/uploads/200803/21_082901_3.jpg);text-decoration: none;color:#000000; margin:10px 15px 10px 15px;
    }
    .test_buttom a:hover {
    position:relative;left:1px;top:1px;
    }</style><SCRIPT LANGUAGE="JavaScript">
    /*
       模拟日语等级报名网
       主要应用:Filter:Alpha(opacity=0)透明滤镜
       作者:梁 超   2008.06.19
    */
    <!--
    var Timer = 0;
    var Opacity = 0; // 定义透明度
        var $ = function(sId){return document.getElementById(sId)}window.onload = function oDivShow(){ // 显示层  
          $('oDiv').style.display = "block";
          $('oDiv').style.height = document.body.scrollHeight ;
          $('test').style.display = "block";
          Timer = window.setInterval("IncreFilter()",1000);
         
    }function oDivHiden(){ // 隐藏层
       $('oDiv').style.display = "none";
       $('test').style.display = "none";  
    }
    function IncreFilter(){ //减弱透明度
       if(Opacity == 70){
        window.clearInterval(Timer);
        return;
       }
       Opacity += 5; 
       $('oDiv').style.filter = "Alpha(opacity="+Opacity+")"; 
    }function Login(){
       var username = $('username').value;
       var password = $('password').value;
       if(username == "admin" && password == "admin"){
        alert('欢迎使用');
        oDivHiden();
        $('test').value = username;
       }else{
        alert('无法使用');
       }
    }
    //-->
    </SCRIPT></HEAD><BODY>
    <div id="test" style="z-index:100;display:none">
       <div id="test_left"></div>
       <div id="test_right">
       <ul>
       <li><input name="username" type="text" id="username" style="background:url(http://www.52hai.com/2005/uploads/200803/21_082905_4.jpg);width:202px;" onblur="if (this.value == '') { this.style.background='url(http://www.52hai.com/2005/uploads/200803/21_082905_4.jpg)'; } else { this.style.background='url(http://www.52hai.com/2005/uploads/200803/21_082905_4.jpg) 135px 0px'; }" onclick="if (this.value == '') { this.style.background='url(http://www.52hai.com/2005/uploads/200803/21_082905_4.jpg) 135px 0px'; }" maxlength="10" /></li>
       <li><input name="password" type="password" id="password" style="background:url(http://www.52hai.com/2005/uploads/200803/21_082905_4.jpg) 0px -17px;width:202px;" onblur="if (this.value == '') { this.style.background='url(http://www.52hai.com/2005/uploads/200803/21_082905_4.jpg) 0px -17px'; } else { this.style.background='url(http://www.52hai.com/2005/uploads/200803/21_082905_4.jpg) 135px -17px'; }" onclick="if (this.value == '') { this.style.background='url(http://www.52hai.com/2005/uploads/200803/21_082905_4.jpg) 135px -17px'; }" maxlength="10" /></li>
       
       </ul>
       <div class="test_buttom"><a href="#" onclick="Login()">登 录</a><a href="#" onclick="self.location.reload()">刷 新</a></div>
    </div>
    </div>
    <div id='oDiv' style="background-color:darkgray;border:1 solid;position:absolute;Filter:Alpha(opacity=0);display:none;z-index:99;width:100%" > </div>
    你的用户名为:<INPUT TYPE="text" NAME="name" id="name" value="不能用哦">
    <script>for (var i=0; i<30; i++)
    document.write ("<p>这是一段伟大的历史<br />来自全世界的瞩目和掌声</p>") //设置页面的内容,最好能超过一页,以看到屏蔽效果
    </script></BODY>
    </HTML>
    我觉得这个做得还不错
    应该是你要的
    试试看
    ^_*