Copy codeThe Code is as follows:
// Initialize the navigation background, iframe container
Function fnDaoHangBg ()
{
Var h = fnGetHeight (), w = fnGetWidth (); // obtain the 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 embedded IFRAME container in the mask for embedding and displaying other webpages
Iframe. id = 'divdaohangbgiframe ';
Iframe. frameBorder = '0 ';
Iframe. scrolling = "no ";
Iframe. style. overflow = 'ddd ';
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 the close button on the 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 to close the mask.
FnDaoHangBgClose ();
};
$ ('Divdaohangbg '). appendChild (div );
}
$ ('Divdaohangbgiframe'). style. display = 'block ';
$ ('Divdaohangbg '). style. display = 'block ';
}
// Close the mask
Function fnDaoHangBgClose ()
{
If (! $ ('Divdaohangbg ') {return ;}
If (! $ ('Divdaohangbgiframe') {return ;}
$ ('Divdaohangbgiframe'). src = '';
$ ('Divdaohangbgiframe'). style. display = 'none ';
$ ('Divdaohangbg '). style. display = 'none ';
}
// Call, embedded url
Function fnDaoHangBgShow (url)
{
FnDaoHangBg ();
$ ('Divdaohangbgiframe'). src = url;
}
$ () And $ C () represent
$ (Id), the object for obtaining this id, document. getElementById (id)
$ C (tag), create a tag, document. createElement (tag );