Home > Web Front-end > JS Tutorial > body text

js forms a masking effect example code for the page_javascript skills

WBOY
Release: 2016-05-16 17:05:29
Original
1172 people have browsed it

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--; 🎜 >

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template