是js + div + css 实现的  你可以去下载 ext 那里面有很多那样的功能

解决方案 »

  1.   

    ext是什么?不好意思我不太懂.能说详细点吗?
      

  2.   

    JK的代码........
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>JK:支持民族工业,尽量少买X货</title>
    </head><body style="margin:0;"><div style="font-size:10pt;">
    注1:灰掉页面<br/> <br/>  
    注:本页面仅在IE6下测试过。其它浏览器或其它版本未经测试。<br/>         
    注-----:JK:<a href="mailTo:[email protected]?subject=About Body">[email protected]</a><br/>      
    <hr/>  
    </div>
    <select><option >test</option></select>
    <input> 
    <input type=button value="点击将页面灰掉" onclick="disableBodyArea();"> 
    <br><br><br><br>
    <br><br><br><br>
    <select><option >test</option></select>
    <br><br><br><br>
    <br><br><br><br>
    <select><option >test</option></select>
    <br><br><br><br>
    <br><br><br><br>
    </body></html>
    <script >function disableBodyArea(){
    if(!document.all) return false;//For firefox etc.
    window.topCoverDiv=document.createElement("<div style='z-index:100;position:absolute;top:expression(this.offsetParent.scrollTop);left:expression(this.offsetParent.scrollLeft);width:100%;height:100%;filter:alpha(opacity=20);background-color:#888888;' oncontextmenu='return false;'>");
    topCoverDiv.innerHTML="&nbsp;"
    document.body.appendChild(topCoverDiv);
    var allSelects=document.getElementsByTagName("select");
    for(var i=0;i<allSelects.length;i++) {
    allSelects[i].disabled=true;
    allSelects[i].style.backgroundColor="#EEEEEE";
    }
    }</script>
      

  3.   

    lightbox
    这个有下载的
    也有说明教你怎么用
      

  4.   

    4楼的代码只能在ie6中可以哦,在firefox中就不行了哦还有想要弹出对话框的,完整的代码谁有哦?不过还是谢谢啦lightbox 这是什么?
      

  5.   

    给个我用的给你看看
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title></title>
    </head><body style="margin:0;">
    <select><option >test</option></select>
    <input> 
    <input type=button value="点击将页面灰掉" onclick="disableBodyArea();"> 
    <br><br><br><br>
    <br><br><br><br>
    <select><option >test</option></select>
    <br><br><br><br>
    <br><br><br><br>
    <select><option >test</option></select>
    <br><br><br><br>
    <br><br><br><br>
    </body></html>
    <script>
    //这里初始化遮盖面的,使用IFRAME
    window.onload=function()
      {
         var iframe=document.createElement("iframe");
         iframe.id="";
         iframe.style.display='none';
         iframe.style.position='absolute';
         iframe.style.top='0px';
         iframe.style.left='0px';
         iframe.style.margin='0px';
         iframe.style.width='100%';
         iframe.style.height='100%';
         iframe.style.backgroundColor='#666666';
         iframe.style.zIndex=100;
         iframescrolling="no";
         iframe.frameborder="0";
         if(document.all)//ie
           iframe.style.filter="Alpha(opacity=60)";
         else
           iframe.style.opacity="0.6";
         document.body.appendChild(iframe);      
      }
    function disableBodyArea(){
    document.getElementById("").style.display=""
    }</script>
      

  6.   

    已经找到一个好的。大家想学习的看看这个网址吧。http://www.blueidea.com/download/product/2007/5182.asp
    都有详细讲的
    谢谢各位啦!
      

  7.   

    不如用下我的试一试,这可是我经常用的一种...效果还不错<html>
        <head>
            <title>LIGHTBOX EXAMPLE</title>
            <style>
            .black_overlay{
                display: none;
                position: absolute;
                top: 0%;
                left: 0%;
                width: 100%;
                height: 100%;
                background-color: black;
                z-index:1001;
                -moz-opacity: 0.8;
                opacity:.80;
                filter: alpha(opacity=80);
            }
            .white_content {
                display: none;
                position: absolute;
                top: 25%;
                left: 25%;
                width: 50%;
                height: 50%;
                padding: 16px;
                border: 16px solid orange;
                background-color: white;
                z-index:1002;
                overflow: auto;
            }
        </style>
        </head>
        <body>
            <p><a href="http://www.nextcool.cn" target="_blank">NextCool</a>收集整理,可以根据自己要求修改css样式<a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">点击这里打开窗口</a></p>
            <div id="light" class="white_content">This is the lightbox content. <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">Close</a></div>
            <div id="fade" class="black_overlay"></div>
        </body>
    </html>