屏蔽层

<HTML>
<HEAD>
<TITLE>jquery加CSS遮蔽层</TITLE>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>

<SCRIPT language=javascript type=text/javascript>
/**
* 锁屏
*/
function cbbBlockUI()
{
	  $("body").append("<div id='shadow'></div>");
	  $("#shadow").css(
    {
        visibility:"visible",
        position:"absolute",
        "z-index":"10",
        left:"0",
        top:"0",
        width:"100%",
        height:"100%",
        "background-color":"#000000",
        filter:"alpha(opacity:50)",
        opacity: "0.5"
    });
};
/**
* 解屏
*/
function CbbUnBlockUI()
{
    $("div").remove("#shadow");
};
/**
* 测试
*/
function createDiv()
{
         cbbBlockUI();
    	if (confirm("你想解屏吗?"))
    	{
    		  CbbUnBlockUI();
    	}
</SCRIPT>
</HEAD>
<BODY>
	<DIV style="TEXT-ALIGN: center">
	    <INPUT id="btnShow" onclick="createDiv()" type="button" value="Display"> 
  </DIV>
</BODY>
</HTML>

你可能感兴趣的:(JavaScript,html,jquery,css,script)