Home  >  Article  >  Web Front-end  >  Sample code for adding a mask layer to a specified element_jquery

Sample code for adding a mask layer to a specified element_jquery

WBOY
WBOYOriginal
2016-05-16 17:03:361416browse
Copy code The code is as follows:

//Mask layer
$j("
").css({
position:'absolute',
top:0,
left:0,
backgroundColor:"#808080" ,
opacity:0.1,
zIndex:300

}).height($j(document).height()).width($j(document).width()).hide ().appendTo("#bgCover");

bgCover is the id of the target element
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn