Core code of the pop-up layer of multiple browsers. If you need a friend, you can test that this is obtained from the website you are using.
The Code is as follows:
// JavaScript Document
Var dv;
Var dvMsg;
Function customalert ()
{
DvMsg = document. createElement ("p ");
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 ("p ");
Imgs. setAttribute ("id", "pic ");
Imgs. title = "close ";
Imgs. style. float = "left ";
Imgs. style. height = "20px ";
Imgs. innerHTML = "";
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 pstr = document. createElement ("p ");
Pstr. setAttribute ("id", "info ");
Pstr. style. left = "0 ";
Pstr. style. position = "absolute ";
Pstr. style. marginTop = "10px ";
Pstr. style. zIndex = "1115 ";
Pstr. innerHTML ="";
Document. getElementById ("msg"). appendChild (pstr );
}
Function scrollps ()
{
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", scrollps );
Window. onscroll = scrollps;
Window. onload = scrollps;