mask layer code

css style as DIV style
/*mask layer*/
#mid{
display:none;
width:100%;
height:100%;
background:#000;
position:absolute;
top:0;
left:0;
z-index :10;
opacity:0.4; /*Transparency of background:(for Firefox;)*/
filter:alpha(opacity =40); /*Transparency of background:(for IE);
}
div layer
<div id="mid" ></div>
Enable the mask layer by showing or not showing the div layer

document.getElementById('mid').style.display="none/block";
$("mid").style.display='' ''';
Principle: The layer is displayed and floated to the z-index:10 page.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326510619&siteId=291194637