HTML弹窗

弹窗一直在浏览器居中

	#addForm{
     
  		opacity:0;
        position:fixed; 
        *position:absolute; 
        width:30%; 
        height:250px; 
        top:50%; 
        left:35%; 
        margin:-50px 0 0 -50px;
        background-color:white;
    }

弹窗显示时其它界面为灰色且不可点击

	#addForm{
     
  		z-index: 3;
    }
	
	#qitadiv{
     
		z-index: 1;
	}

	#temp{
     
		float:left;
		background-color: #000;
		opacity: 0.3;
		width: 100%;
		height: 100%;
		z-index: 2;
		position:absolute;
		left:0px;top:0px;
		display:none;
	}
	function xianshi(){
     
		$("#addForm").css("opacity","1");
		$("#temp").css("display","block");
	}
		
	function guanbi(){
     
		$("#addForm").css("opacity","0");
		$("#temp").css("display","none");
	}

你可能感兴趣的:(HTML)