做网站,在主页上,想点击登录按钮弹出登陆页(就是浮动弹出一个类似小窗口的登陆页,是一个.aspx的页面,),然后背景都变灰,无法点击,登录完了重新刷新此页。怎么写?就是类似腾讯qq的登录

解决方案 »

  1.   


    <!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>
        <title>无标题页</title>
       <style type="text/css">
       #dialog1
    {
        position: absolute;
        top: 0px;
        left: 0pt;
        width: 100%;
        height: 100%;
        background-color: Black;
        filter: alpha(opacity=50);
        -moz-opacity: 0.5;
        text-align: center;
         display:none;
    }
    #dialog2
    {
        border: 1px solid rgb(51, 102, 153);
        background: white;
        position: absolute;
        width: 100px;
        height: 100px;
        top: 135px;
        left: 232px;
        display:none;
    }
       </style> 
       <script>
       function show()
       {
       document.getElementById("dialog1").style.display="block";
         document.getElementById("dialog2").style.display="block";
       }
          function hide()
       {
       document.getElementById("dialog1").style.display="none";
         document.getElementById("dialog2").style.display="none";
       }
       </script>
    </head>
    <body>
        <input id="Button1" type="button"  value="弹出" onclick="show()" />
            <div id="dialog1">
            </div>
            <div  id="dialog2" align="center" >
                <input id="btnconfirm" type="button" value="确定" onclick="hide()" />
      </div>
    </body>
    </html>
      

  2.   

    只要用CSS控制背景变灰之类的显示问题就行,不一定用DIV,服务器控件panel也可以