$(function(){
$("#popPay .close").click(function(){
$("#mask").hide();
$("#popPay").hide();
})
$("#submit").click(function(){
popWindow( $("#mask"),$("#popPay"));
})
function popWindow( $mask,$pop){ var docH = $(document).height(), docW = $(document).width(), popW = $pop.width(), popH = $pop.height(); screenH = $(window).height(); $mask.css({"width": docW,"height":docH,"display":"block"}); $pop.css({"left": docW/2-popW/2+"px","top":screenH/2-popH/2+"px","display":"block"}); } })
简单的带遮照弹出层-在屏幕窗口内水平居中 垂直居中兼容IE6-IE9 firefox chrome