Home  >  Article  >  Web Front-end  >  js forms a masking effect example code for the page_javascript skills

js forms a masking effect example code for the page_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:05:291145browse

Please download the jquery library before using this code

Copy the code The code is as follows:

var maskStackCount = 0;

function mask(method){

//This is the window you want to mask. What I want to mask here is an iframe window. You can also use var winObj=$(window)

var winObj=window.top.$("body").find("iframe[name='dialognormaliframe']");

if(typeof method == "undefined"){
method="open";
}
if (method == "open") {
if (maskStackCount <= 0 ) {
var mask = $("

").appendTo("body" );
mask.css({
width: winObj.width() "px",
height: winObj.height() "px",
filter: "alpha(opacity=60) "
}).show();
winObj.on("resize.mask", function(){
mask.css({
               width:      winObj.width() "px",
Height: Winobj.height () "PX"
});
});
}
MaskstackCount;
}
Else if (method == "close" "" ){
    maskStackCount--; 🎜 >

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