1 2 3 4 5 6 7 #maskBackground { position: absolute; left: 0px; top: 0px; opacity: 0.2; background-color: red; display: none; z-index: 99; } 8 /*蒙板*/ 9 #maskTip { position: absolute; border: 1px solid blue; background-color: white; z-index: 100; display: none; }10 11 12 13 function ShowMask() {14 //让背景蒙板显示,而且在填满整个浏览器15 var masBg = document.getElementById('maskBackground');16 masBg.style.display = 'block';17 masBg.style.width = window.innerWidth + 'px';18 masBg.style.height = window.innerHeight + 'px';19 //让前景蒙板显示,而且在浏览器的中间20 var maskTip = document.getElementById('maskTip');21 22 //要更改的地方 宽度高度23 maskTip.style.width = '100px';24 maskTip.style.height = '100px';25 26 maskTip.style.left = (window.innerWidth - parseInt(maskTip.style.width)) / 2 + 'px';27 maskTip.style.top = (window.innerHeight - parseInt(maskTip.style.height)) / 2 + 'px';28 maskTip.style.display = 'block';29 30 }31 32 function HideMask() {33 document.getElementById('maskBackground').style.display = 'none';34 document.getElementById('maskTip').style.display = 'none';35 }36 37 38 39 40 41
查看更多关于蒙板模态对话框_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did110851
蒙板模态对话框_html/css_WEB-ITnose
阅读:41次