Implementation
Attach Images
Implementation Method:
Add
Style
Copy codeThe Code is as follows:
. Progress {z-index: 2000}
. Mask {position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1000; background-color: # 2f2f}
Node
Copy codeThe Code is as follows:
<Div id = "maskOfProgressImage" class = "mask" style = "display: none"> </div>
Js
Copy codeThe Code is as follows:
<P> </p> <p> var img = $ ("# progressImgage ");
Var mask = $ ("# maskOfProgressImage"); </p>
Copy codeThe Code is as follows:
$. Ajax ({
Url: url,
Type: "post ",
DataType: "json ",
Data: data,
BeforeSend: function (xhr ){
Img.show().css ({
"Position": "fixed ",
"Top": "40% ",
"Left": "45% ",
"Margin-top": function () {return-1 * img. height ()/2 ;},
"Margin-left": function () {return-1 * img. width ()/2 ;}
});
Mask.show().css ("opacity", "0.1 ");
},
Success: function (result ){
DoSuccess ()
},
Complete: function (xhr ){
Img. hide ();
Mask. hide ();
}
});