Home > Web Front-end > JS Tutorial > Specific implementation of a masking effect using js iframe to form a page_javascript skills

Specific implementation of a masking effect using js iframe to form a page_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:06:04
Original
990 people have browsed it

Before using this code, please download the jquery library

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--;
$("#window-mask").remove();
winObj.off("resize.mask");
}
}
Related labels:
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
Latest Issues
Where is js written?
From 1970-01-01 08:00:00
0
0
0
js file code not found
From 1970-01-01 08:00:00
0
0
0
js addClass not working
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template