var mybg = document.createElement("div");
//弹出层
function d_x(){
var h = document.body.clientHeight;
var w = document.body.clientWidth;
myAlert = document.getElementById("alert");
myAlert.style.display = "block";
myAlert.style.position = "absolute";
myAlert.style.top = (h/2)+"px";
myAlert.style.left = (w/2)+"px";
//myAlert.style.marginTop = "-200px";
//myAlert.style.marginLeft = "-250px";
mybg.setAttribute("id","mybg");
mybg.style.background = "#000";
mybg.style.display = "block"; mybg.style.width = "100%";
mybg.style.height = h+"px";
mybg.style.position = "absolute";
mybg.style.top = "0";
mybg.style.left = "0";
mybg.style.zIndex = "500";
mybg.style.opacity = "0.5";
mybg.style.filter = "Alpha(opacity=40)";
document.body.appendChild(mybg);
//取消层
myAlert.style.display = "none";
mybg.style.display = "none";
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货