Copy Code code as follows:
Initialize navigation background, IFRAME container
function FNDAOHANGBG ()
{
var h = fngetheight (), w = fngetwidth ();//Get background window size
if (!$ (' DIVDAOHANGBG '))
{
var div = $C (' div ');//Create a background mask
div.id = ' DIVDAOHANGBG ';
Div.style.backgroundColor = ' black ';
div.style.position = ' absolute ';
Div.style.filter = ' alpha (opacity=80) ';
Div.style.opacity = '. 80 ';
Div.style.zIndex = 100001;
Div.style.left = 0;
div.style.top = 0;
Div.style.width = w+ ' px ';
div.style.height= h+ ' px ';
Document.body.appendChild (DIV);
}
if (!$ (' Divdaohangbgiframe '))
{
var iframe;
iframe = this. $C (' iframe ');//Create an inline IFRAME container inside the mask for embedding other web pages
iframe.id = ' divdaohangbgiframe ';
Iframe.frameborder = ' 0 ';
iframe.scrolling = "No";
Iframe.style.overflow = ' hidden ';
Iframe.allowtransparency = ' true ';
Iframe.style.display = ' None ';
Iframe.style.width = w+ ' px ';//800
Iframe.style.height = h+ ' px ';//620
Iframe.style.marginTop = ' 75px ';//800
$ (' DIVDAOHANGBG '). appendchild (IFRAME);
}
if (!$ (' Divdaohangbgclose '))
{
var div = $C (' div ');//Create a close button on a mask
div.id = ' divdaohangbgclose ';
div.style.position = ' absolute ';
Div.style.backgroundimage= ' url (images/closb.gif) ';
Div.style.zIndex = 100003;
Div.style.right = 10;
Div.style.top = 20;
Div.style.width = ' 82px ';
div.style.height= ' 30px ';
div.title= ' close ';
Div.style.cursor= ' hand ';
Div.onclick=function () {//Click Time, Close mask
Fndaohangbgclose ();
};
$ (' DIVDAOHANGBG '). appendchild (Div);
}
$ (' Divdaohangbgiframe '). style.display= ' block ';
$ (' DIVDAOHANGBG '). style.display= ' block ';
}
Close Mask
function Fndaohangbgclose ()
{
if (!$ (' DIVDAOHANGBG ')) {return;}
if (!$ (' Divdaohangbgiframe ')) {return;}
$ (' Divdaohangbgiframe '). src= ';
$ (' Divdaohangbgiframe '). style.display= ' None ';
$ (' DIVDAOHANGBG '). style.display= ' None ';
}
Call, inline URL
function fndaohangbgshow (URL)
{
FNDAOHANGBG ();
$ (' Divdaohangbgiframe '). Src=url;
}
where $ () and $c () respectively represent
$ (ID), gets the object of the ID, document.getElementById (ID)
$C (tag), create a label, document.createelement (tag);