Style code:
Copy codeThe Code is as follows: # div_maskContainer
{
Display: none;
}
/* Mask style */
# Div_Mask {
Z-index: 1000;
Filter: alpha (opacity = 40 );
Position: absolute;
Left: 0px;
Top: 0px;
Background-color: # D4D0C8;
}
/* Display information style */
# Div_loading {
Width: 300px; height: 60px; position: absolute;
Border: 1px outset # B4E0F2;
Padding-top: 40px;
Text-align: center;
Background-color: # CCE9F9;
Z-index: 10000;
Filter: alpha (opacity = 100 );! Important
}
Js control code:Copy codeThe Code is as follows :/**
Mask Information Control
Usage:
1. Reference mask.css
2. Reference mask. js
3. Call Method
Var obj = new MaskControl ();
// Display the mask prompt information
Obj. show ("displayed prompt information ");
// Hide the mask prompt information
Obj. hide ();
// Display the prompt information and disable it every timeOut (1000 indicates 1 second)
Obj. autoDelayHide = function (html, timeOut)
*/
Function MaskControl (){
This. show = function (html ){
Var loader = $ ("# div_maskContainer ");
If (loader. length = 0 ){
Loader = $ ("<div id = 'div _ maskContainer '> <div id = 'div _ mask'> </div> <div id = 'div _ loading'> </div> </div> ");
$ ("Body"). append (loader );
}
Self. loader = loader;
Var w = $ (window). width ();
Var h = $ (window). height ();
Var divMask = $ ("# div_Mask ");
DivMask.css ("top", 02.16.css ("left", 02.16.css ("width", w2.16.css ("height", h );
Var tipDiv =$ ("# div_loading ");
If (html = undefined)
Html = "";
TipDiv.html (html );
Loader. show ();
Var x = (w-tipDiv.width ()/2;
Var y = (h-tipDiv.height ()/2;
TipDiv.css ("left", x );
TipDiv.css ("top", y );
},
This. hide = function (){
Var loader = $ ("# div_maskContainer ");
If (loader. length = 0) return;
Loader. remove ();
},
This. autoDelayHide = function (html, timeOut ){
Var loader = $ ("# div_maskContainer ");
If (loader. length = 0 ){
This. show (html );
}
Else {
Var tipDiv =$ ("# div_loading ");
TipDiv.html (html );
}
If (timeOut = undefined) timeOut = 3000;
Window. setTimeout (this. hide, timeOut );
}
}