首页 > 代码库 > Mask遮罩层

Mask遮罩层

1.html:

<div id="mask"></div>

2.css:

#mask {

width:100%;

height:100%;

background:#000;

opacity:0.5;

filter:alpha(opacity=50);

position:absolute;

left:0;

top:0;

}

3.js:

document.getElementById("mask").style.height = document.documentElement.scrollHeight+"px";

Mask遮罩层