文件名称:Web遮罩層的實現方式
文件大小:1KB
文件格式:RAR
更新时间:2014-07-13 09:22:26
Web遮罩層的實現方式
//1層遮罩整個IFrame
function hideIframe1()
{
hideIframe(0);
}
//2層遮罩整個IFrame
function hideIframe2()
{
hideIframe(1);
}
//3層遮罩整個IFrame
function hideIframe3()
{
hideIframe(2);
}
//遮罩整個IFrame
function hideIframe(level)
{
var div = document.createElement("div");
var iframe=document.createElement("iframe");
var img=document.createElement("img");
div.id = "InnerDiv";
div.style.width=document.documentElement.scrollWidth +"px"
div.style.height=document.documentElement.scrollHeight +"px"
div.style.margin="0px";
div.style.padding="0px";
div.style.zIndex="19999";
div.style.position="absolute";
div.style.backgroundColor="black";
div.style.left="0px";
div.style.top="0px";
div.style.filter="alpha(opacity=80)";
div.style.opacity="0.8";
iframe.id = "LoadingIframe";
iframe.style.width="100%";
iframe.style.height="100%";
iframe.style.backgroundColor="black";
img.id = "LoadingImg";
img.style.width="219px";
img.style.height="66px";
img.style.marginTop="-33px";
img.style.marginLeft="-109.5px";
img.style.padding="0px";
img.style.zIndex="20000";
img.style.position="absolute";
img.style.left="50%";
img.style.top="50%";
var path = "";
for(var i=0;i
【文件预览】:
Web遮罩層的實現方式
----Mainpage.js(4KB)