<!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";}
高度顯示是8,為什么
qiuxiaoyu
2016-05-12 16:51:54