// 加入透明背景
var body = document.body;
var backgroundDiv = document.createElement("div");
backgroundDiv.style.cssText = "left:0;top:0;
position:fixed;
background:#ddd;opacity:0.8;width:100%;height:100%";
body.appendChild(backgroundDiv);
// 加入居中弹出框
var newDiv = document.createElement("div");
newDiv.style.cssText = "position:absolute;margin:auto;
left:0;right:0;top:0;
bottom:0;width:400px;
height:200px;background:white;";
backgroundDiv.appendChild(newDiv); // 丰富弹出框内容 ......
博客主要围绕如何使用纯JavaScript实现带有灰色半透明背景的弹出框展开,聚焦于前端开发中利用JS实现特定功能的内容。
4972

被折叠的 条评论
为什么被折叠?



