弹出层已经做完了,需要将页面变灰不能操作,请问下应该怎么写代码?核心的代码?

解决方案 »

  1.   

    百度一下jquery dialog插件
    JF..........
      

  2.   


    <style>
    .d{
    position:absolute;
    filter:alpha(opacity=20);
    background-color:#000;
    width:100%;
    height:100%;
    left:0;
    top:0;
    }
    </style>
    <script>
    function show(){
    var div = document.createElement("div");
    div.className = "d";
    document.body.appendChild(div);
    }
    </script>
    <input type="button">
    <input type="button" value="弹出层" onclick="show()">
      

  3.   

     var gb = $("<div/>").attr("id","gb") 
        .css({top:"0",left:"0",zIndex:"1",position:"absolute",filter:"alpha(opacity=10)",opacity:"0.3",background:"#CCC"}) 
        .css("width","100%").css("height",h2).appendTo(document.body ) ;