Copy codeThe Code is as follows:
// Loading
Function showLoad (tipInfo ){
Var iWidth = 120; // The width of the pop-up window;
Var iHeight = 0; // The height of the pop-up window;
Var scrolltop = 0;
Var scrollleft = 0;
Var cheight = 0;
Var cwidth = 0;
Var eTip = document. createElement ('div ');
ETip. setAttribute ('id', 'tipdiv ');
ETip. style. position = 'absolute ';
ETip. style. display = 'none ';
ETip. style. border = 'solid 0px # D1D1D1 ';
ETip. style. backgroundColor = '# 4B981D ';
ETip. style. padding = '5px 15px ';
If (document. body. scrollTop) {// This is JavaScript compatible
Scrollleft = document. body. scrollLeft;
Scrolltop = document. body. scrollTop;
Cheight = document. body. clientHeight;
Cwidth = document. body. clientWidth;
}
Else {
Scrollleft+document.doc umentElement. scrollLeft;
Scrolltop=document.doc umentElement. scrollTop;
Cheightappsdocument.doc umentElement. clientHeight;
Cwidthdomaindocument.doc umentElement. clientWidth;
}
IHeight = eTip. offsetHeight;
Var v_left = (cwidth-iWidth)/2 + scrollleft ;//
Var v_top = (cheight-iHeight)/2 + scrolltop;
ETip. style. left = v_left + 'px ';
ETip. style. top = v_top + 'px ';
ETip. innerHTML = ' <span style = 'color: # ffffff; font-size: 12px '>' + tipInfo + '</span> ';
Try {
Document. body. appendChild (eTip );
} Catch (e ){}
$ ("# TipDiv" ).css ("float", "right ");
$ ("# TipDiv" ).css ("z-index", "99 ");
$ ('# TipDiv'). show ();
ShowMark ();
}
Function closeLoad (){
$ ('# TipDiv'). hide ();
HideMark ();
}
// Display the gray layer
Function ShowMark (){
Var xp_mark = document. getElementById ("xp_mark ");
If (xp_mark! = Null ){
// Set the DIV
Xp_mark.style.left = 0 + "px ";
Xp_mark.style.top = 0 + "px ";
Xp_mark.style.position = "absolute ";
Xp_mark.style.backgroundColor = "#000 ";
Xp_mark.style.zIndex = "1 ";
If (document. all ){
Xp_mark.style.filter = "alpha (opacity = 50 )";
Var Ie_ver = navigator ["appVersion"]. substr (22, 1 );
If (Ie_ver = 6 | Ie_ver = 5) {hideSelectBoxes ();}
}
Else {xp_mark.style.opacity = "0.5 ";}
Xp_mark.style.width = "100% ";
Xp_mark.style.height = "100% ";
Xp_mark.style.display = "block ";
}
Else {
// Add div explainDiv to the page. Note that it must be the first element in the body. Otherwise, IE6 is abnormal.
$ ("Body"). prepend ("<div id = 'xp _ mark' style = 'display: none; '> </div> ");
ShowMark (); // continue callback
}
}
// Hide the gray layer
Function HideMark (){
Var xp_mark = document. getElementById ("xp_mark ");
Xp_mark.style.display = "none ";
Var Ie_ver = navigator ["appVersion"]. substr (22, 1 );
If (Ie_ver = 6 | Ie_ver = 5) {showSelectBoxes ();}
}