例如QQ书签
http://shuqian.qq.com/
点登陆以后会封屏幕 只有登陆口给段封屏的代码不需要登陆内容 

解决方案 »

  1.   

    http://scriptlover.com/controls/里面有
      

  2.   


    <style type="text/css">
    .opaqueLayer{display:none;position:absolute;top:0px;left:0px;opacity:0.1;filter:alpha(opacity=10);background-color: #000000;z-Index:1000;}
    </style>
    <script type="text/javascript">
    function getBrowserHeight() {
        var intH = 0;
        var intW = 0;
       
        if(typeof window.innerWidth  == 'number' ) {
           intH = window.innerHeight;
           intW = window.innerWidth;
        } 
        else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
            intH = document.documentElement.clientHeight;
            intW = document.documentElement.clientWidth;
        }
        else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
            intH = document.body.clientHeight;
            intW = document.body.clientWidth;
        }    return { width: parseInt(intW), height: parseInt(intH) };
    }  function setLayerPosition() {
        var shadow = document.getElementById("shadow");
        var bws = getBrowserHeight();
        shadow.style.width = bws.width + "px";
        shadow.style.height = bws.height + "px";
        shadow = null;
    }function showLayer() {
        setLayerPosition();
        var shadow = document.getElementById("shadow");
        shadow.style.display = "block"; 
        shadow = null;
    }function hideLayer() {
        var shadow = document.getElementById("shadow");
        shadow.style.display = "none"; 
        shadow = null;
    }
    window.onload=function(){
      if(document.all) document.getElementById("shadow").contentWindow.document.body.onclick = hideLayer;
      else document.getElementById("shadow").contentWindow.onclick = hideLayer;
      window.onresize = setLayerPosition;
    }
    </script>
    <iframe id="shadow" class="opaqueLayer" style="border:0;" src="about:blank"></iframe>
    <input type="button" value="click" onclick="showLayer();">
    <select><option>xxxxx</option></select>
      

  3.   

    退出登录后进这个页面点登录:
    http://forum.csdn.net/PointForum/Forum/ReplyT.aspx?forumID=467d91e3-dd10-480b-a322-71b65e66c736&topicID=39675ed2-8677-4f43-b371-6a4e60a85acb&postDate=2009-10-01+15%3a36%3a24&v=13
      

  4.   

    ie6,7,ff下测试过是可以的,只是加了
    if(document.all) document.getElementById("shadow").contentWindow.document.body.onclick = hideLayer;
      else document.getElementById("shadow").contentWindow.onclick = hideLayer;
    点按钮后,再点击页面就取消了(因为没有写取消按钮)
      

  5.   

    hookee大不好意思 昨天因为太忙没上来您代码给我后表现是这样的 
    点了CHICK以后旁边的XXXX的对象会消失不见但是屏幕并没有黑下来
    是原本就这么设置还是?
      

  6.   

    我可能会造成上面问题的原因是因为AB页原本就白色 
    当AB页替换成163以后发现一个问题一旦点后会出现以下问题
    首先是过程
    点击CHINK以后
    封屏
    页面不能点击[不能实现]
    点击的按纽霞石
    取消封屏
    <style type="text/css">
    .opaqueLayer{display:none;position:absolute;top:0px;left:0px;opacity:0.1;filter:alpha(opacity=10);background-color: #000000;z-Index:1000;}
    </style>
    <script type="text/javascript">
    function getBrowserHeight() {
        var intH = 0;
        var intW = 0;
       
        if(typeof window.innerWidth  == 'number' ) {
           intH = window.innerHeight;
           intW = window.innerWidth;
        } 
        else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
            intH = document.documentElement.clientHeight;
            intW = document.documentElement.clientWidth;
        }
        else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
            intH = document.body.clientHeight;
            intW = document.body.clientWidth;
        }    return { width: parseInt(intW), height: parseInt(intH) };
    }  function setLayerPosition() {
        var shadow = document.getElementById("shadow");
        var bws = getBrowserHeight();
        shadow.style.width = bws.width + "px";
        shadow.style.height = bws.height + "px";
        shadow = null;
    }function showLayer() {
        setLayerPosition();
        var shadow = document.getElementById("shadow");
        shadow.style.display = "block"; 
        shadow = null;
    }function hideLayer() {
        var shadow = document.getElementById("shadow");
        shadow.style.display = "none"; 
        shadow = null;
    }
    window.onload=function(){
      if(document.all) document.getElementById("shadow").contentWindow.document.body.onclick = hideLayer;
      else document.getElementById("shadow").contentWindow.onclick = hideLayer;
      window.onresize = setLayerPosition;
    }
    </script>
    <iframe id="shadow" class="opaqueLayer" style="border:0;" src="http://www.163.com"></iframe>
    <input type="button" value="click" onclick="showLayer();">
    <select><option>xxxxx</option></select>
      

  7.   

    iframe是用于遮罩的,不能放上src, 如果要不同的背景色,可以用一个blank.htm, 内容是:
    <body style="background:black;"><body>即可
    原本用div的,div在ie6下挡不住select,所以用iframe.
    <style type="text/css">
    .opaqueLayer{display:none;position:absolute;top:0px;left:0px;opacity:0.6;filter:alpha(opacity=60);background-color: #000000;z-Index:1000;}
    </style>
    <script type="text/javascript">
    function getBrowserHeight() {
        var intH = 0;
        var intW = 0;
       
        if(typeof window.innerWidth  == 'number' ) {
           intH = window.innerHeight;
           intW = window.innerWidth;
        } 
        else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
            intH = document.documentElement.clientHeight;
            intW = document.documentElement.clientWidth;
        }
        else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
            intH = document.body.clientHeight;
            intW = document.body.clientWidth;
        }    return { width: parseInt(intW), height: parseInt(intH) };
    }  function setLayerPosition() {
        var shadow = document.getElementById("shadow");
        var bws = getBrowserHeight();
        shadow.style.width = bws.width + "px";
        shadow.style.height = bws.height + "px";
        shadow = null;
    }function showLayer() {
        setLayerPosition();
        var shadow = document.getElementById("shadow");
        shadow.style.display = "block"; 
        shadow = null;
    }function hideLayer() {
        var shadow = document.getElementById("shadow");
        shadow.style.display = "none"; 
        shadow = null;
    }
    window.onload=function(){
      //if(document.all) document.getElementById("shadow").contentWindow.document.body.onclick = hideLayer;
      //else document.getElementById("shadow").contentWindow.onclick = hideLayer;
      window.onresize = setLayerPosition;
    }
    </script>
    <iframe id="shadow" class="opaqueLayer" style="border:0;background:black;"  src="blank.html"></iframe>
    <input type="button" value="click" onclick="showLayer();">
    <select><option>xxxxx</option></select>
      

  8.   

    11楼这段代码还是不行吧.
    这个看上去是好像把屏封住了.其实不然.你使用Tab键试试...马上就可以切到被封住的内容里去.然后使用Enter确认一样可以执行.
    这样也能叫封屏了?