<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>弹出层效果</title> <link rel="stylesheet" type="text/css" href="tanchu.css"/> <script src="tanchu.js" type="text/javascript"></script> </head> <body> <div id="mask"> </div> <div id="login"> <div id="loginCon" class="loginCon"> <div id="close"> </div> </div> </div> </body></html>#mask{ position: absolute; background: #000000; opacity: 0.75; filter: alpha(opacity=75); height: 1000px; width: 100%; left: 0; top: 0; z-index: 1000;}#login{ position: fixed; left: 30%; top:30%; z-index: 1020;}.loginCon{ width: 670px; height: 380px; background: blue; position: relative;}#close{ display: block; width: 30px; height: 30px; background: #CCCCCC; cursor: pointer; position: absolute; top:10px; right: 10px;}window.onload=function(){ var oBtn=document.getElementById("btnLogin") var sHeight=document.documentElement.scrollHeight; var sWidth=document.documentElement.scrollWidth; alert(sWidth); alert(sHeight); var oMask=document.createElement("div"); oMask.id="mask";}
添加回答
举报
0/150
提交
取消