Please download the jquery library before using this forging code
Copy code code as follows:
Var MaskstackCount = 0;
Function Mask (Method) {
// Here is the window you want to make a mask. What I want to cover here is a iframe window. You can also use VAR WINOBJ = $ (window)
varWinObj = Window.top. $ ("Body").
If (Typeof Method == "UNDEFINED") {{
Method = "Open";
}
if (method == "Open") {
if (MaskstackCount <= 0) {
var mask = $ ("<div ID = 'Window-Mask' Class = 'Window-Mask' STYLE = 'Display: None'> </DIV>").
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-;
$ ("#window -amask"). Remove ();
WinObj.Off ("Resize.mask");
}
}