This article mainly introduces JS form a mask Effect instance code of the page, a friend in need can refer to the
Before using this forged code, please download the jquery Library code as follows: var maskstackcount = 0; Function Mask (method) { //This is the window you want to mask, I want to mask 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= "Ope n "; } if (method = = "Open") { &NBSP ; if (maskstackcount <= 0) { var mask = $ ("<div id= ' Window-mas K ' class= ' window-mask ' style= ' display:none ' ></div> '). Appendto ("body"); MASK.CSS ({ Width: winobj.width () + "px", Height: winobj.height () + "px", filter: "Alpha (opacity=60)" &N Bsp }). Show (); Winobj.on ("Resize.mask", function () { & nbsp MASK.CSS ({ Width: winobj.width () + "px", Height: winobj.height () + "px" }); }); maskstackcount++; } Else if (method = "Close") { & nbsp maskstackcount--; &NBSP; $ ("#window-mask"). Remove (); Winobj.off ("Resize.mask"); }}