Copy codeThe Code is as follows:
// JavaScript Document
Var dv;
Var dvMsg;
Function customalert ()
{
DvMsg = document. createElement ("div ");
DvMsg. style. position = "absolute ";
DvMsg. setAttribute ('id', 'msg ');
DvMsg. style. width = "600px ";
DvMsg. style. padding = "10 0 2 0 ";
DvMsg. style. height = "313px ";
DvMsg. style. background = "# ef630d ";
DvMsg. style. border = "1px solid # 6699dd ";
DvMsg. style. zindexes = "1112 ";
Document. body. appendChild (dvMsg );
Document. getElementById ("msg "). style. top = document.doc umentElement. scrollTop + (document.doc umentElement. clientHeight-document. getElementById ("msg "). offsetHeight)/2 + "px ";
Document. getElementById ("msg "). style. left = document.doc umentElement. scrollLeft + (document.doc umentElement. clientWidth-document. getElementById ("msg "). offsetWidth)/2 + "px ";
Var imgs = document. createElement ("div ");
Imgs. setAttribute ("id", "pic ");
Imgs. title = "close ";
Imgs. style. float = "left ";
Imgs. style. height = "20px ";
Imgs. innerHTML = "<a href = \" http://www.jb51.net \ "target = \" _ blank \ "> </a> ";
Imgs. style. color = "# FFF ";
Imgs. style. textAlign = "right ";
Imgs. style. cursor = "pointer ";
Imgs. style. zIndex = "1114 ";
Imgs. onclick = function ()
{
Document. body. removeChild (dvMsg );
Document. body. removeChild (dv );
}
Document. getElementById ("msg"). appendChild (imgs );
Var divstr = document. createElement ("div ");
Divstr. setAttribute ("id", "info ");
Divstr. style. left = "0 ";
Divstr. style. position = "absolute ";
Divstr. style. marginTop = "10px ";
Divstr. style. zindexes = "1115 ";
Divstr. innerHTML = "<embed src = \" gallery/header2.swf \ "pluginspage = \" http://www.macromedia.com/shockwave/download/\ "width = \" 600 \ "height = \" 313 \ "> </embed> ";
Document. getElementById ("msg"). appendChild (divstr );
}
Function scrolldivs ()
{
Document. getElementById ("msg" ).style.topw.document.documentelement.scrolltop((document.doc umentElement. clientHeight-document.getElementById ("msg"). offsetHeight)/2 + "px ";
Document. getElementById ("msg" ).style.left?document.documentelement.scrollleft;(document.doc umentElement. clientWidth-document.getElementById ("msg"). offsetWidth)/2 + "px ";
}
Window. attachEvent ("onresize", scrolldivs );
Window. onscroll = scrolldivs;
Window. onload = scrolldivs;