我的高度不對(duì)好像只有8px,這是為什么呀?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery Validation 插件</title>
<link rel="stylesheet" href=""/>
<style type="text/css">
? ?#mask{
? ? background: #000;
? ? opacity:0.75;
? ? /*解決ie不兼容*/
? ? filter:alpha(opacity=75);
? ? height: 1000px;
? ? width: 100%;
? ? position: absolute;
? ? left:0;
? ? top:0;
? ? z-index: 1000;
? ?}?
? ?#login{
? ? position: fixed;
? ? left: 30%;
? ? top:30%;
? ? z-index: 1001;
? ?}
? ?.logincon{
? ? width: 670px;
? ? height: 380px;
? ? background: url(img/loginBg.png)no-repeat;?
? ? position: relative;
? ? ? }
? #close{
? ? width: 30px;
? ? height: 30px;
? ? background: url(img/close.png) no-repeat;
? ? cursor:pointer;
? ? position: absolute;
? ? right: 0;
? ? top: 0;
? }
</style>
</head>
<!---->
<!--<body>
<dvi id="mask"></dvi>覆蓋層?
<dvi id="login">
? ? <div>
? ? ? ? <div id="close"></div>
? ? </div>
</dvi>內(nèi)容層 --> ?
<script type="text/javascript" >
? window.onload = function(){
? ? var oBtn ?= document.getElementById("btnLogin");//創(chuàng)建元素節(jié)點(diǎn)再生成
? ? //獲取頁(yè)面的高度和寬度
? ? var sHeight = document.documentElement.scrollHeight;
? ? var sWidth ?= document.documentElement.scrollWidth;
? ? var oMask = document.createElement("div")//創(chuàng)建一個(gè)div,下面再給它一個(gè)id
? ? ? ? oMask.id="mask";
? ? ? ? oMask.style.height=sHeight + 'PX';
? ? ? ? oMask.style.width=sWidth + 'PX';
? ? ? ? document.body.appendChild(oMask);//在頁(yè)面追加一個(gè)節(jié)點(diǎn)?
? }
</script>
</body>
</html>
2015-08-22
第六行代碼格式好像不對(duì)?。?/p>