<!DOCTYPE html><html><head><meta charset="UTF-8"><title>登錄彈出框</title><style type="text/css">*{ border-style: none; }#Login_btn{width: 80px;height: 30px;background-color: red;color: white;border-radius: 5px;}.container{ height: 1000px; width: 100%; }#mask{background-color: #000;opacity: 0.65;filter: alpha(opacity=65);height: 1000px;width: 100%;position: absolute;left: 0;top: 0;}#login{position: fixed;left: 36%;top: 5%;}.logincon{width: 398px;height: 563px;background:url(QQ圖片20160921173744.png) no-repeat;position: relative;}</style><script type="text/javascript">window.onload=function(){var oBtn=document.getElementById('Login_btn');//獲取登錄按鈕的節(jié)點var sHeight=document.documentElement.scrollHeight;//獲取頁面的高度var sWidth=document.documentElement.scrollWidth;//獲取頁面的寬度var oMask=document.createElement("div");//創(chuàng)建一個“div”oMask.id="mask";oMask.style.height=sHeight+"px";oMask.style.width=sWidht+"px";document.body.appendChild(oMask);//把節(jié)點插入到文檔中}</script></head><body><div><button id="Login_btn" onclick="showPic()">登錄</button></div><!-- <div id="mask"></div><div id="login"><div></div></div> --></body></html>
大神粗來??!為什么我的遮罩層出不來呢??
慕粉18707120945
2016-09-21 19:32:46