遮罩层与模式窗口


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>jQuery UI Example Page</title>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.13.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript">
$(function(){

$('#dialog').dialog({
autoOpen: false,
width: 600,
buttons: {
"Ok": function() {
$(this).dialog("close");
},
"Cancel": function() {
$(this).dialog("close");
}
}
,beforeClose:function(){ $("#full").hide();}
});
});

function openDialog(){
var full = $("#full");
full.css("width",getClientW_H(1)+"px")
.css("height",getClientW_H(2)+"px").show();
$("#dialog").dialog("open");
}
window.onresize=function(){
$("#full").css("width",getClientW_H(1)+"px")
.css("height",getClientW_H(2)+"px");
}
function getClientW_H(type){
if(1==type){ //width
return Math.max(Math.max(document.body.scrollWidth,document.body.clientWidth),
Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth));
}else{ //height
return Math.max(Math.max(document.body.scrollHeight,document.body.clientHeight),
Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight))
}
}
</script>
<style type="text/css">
*{font-size:13px}
#full{position: absolute;background:#9DA7C3;left: 0;top: 0;display: none; z-index:2;filter:alpha(opacity=50);opacity :0.5}
</style>

</head>
<body>
<div>
<input type="button" id="btn" value="打开模式窗口" onclick="openDialog()"/><br>

<div id="full"></div>

<div id="dialog" title="系统提示">
这是dialog
</div>



</body>
</html>




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值