This effect can be roughly divided into two steps: 1. Let "please wait... "The image is always displayed in the center of the screen. 2. Set the mask layer to" please wait... "The page under the image is masked.
1. Make the "please wait..." image always show in the center of the screen
- // Make the specified DIV always display in the center of the screen
- Function letDivCenter (divName ){
- Var top = ($ (window). height ()-$ (divName). height ()/2;
- Var left = ($ (window). width ()-$ (divName). width ()/2;
- Var scrollTop = $ (document). scrollTop ();
- Var scrollLeft = $ (document). scrollLeft ();
- Detail (divname).css ({position: 'absolute ', 'top': top + scrollTop, left: left + scrollLeft}). show ();
- }
Ii. Set the mask Layer
- <Style type = "text/css">
- # LockWindows {
- Position: absolute; top: 10px; left: 10px; background-color: #777777; z-index: 2; display: none;
- /* Use the private property of Moz Family-moz-opacity: 0.70 */
- /* Use private attribute filter for IE */
- /* The standard attribute opacity supports the CSS 3 browser FF 1.5 )*/
- Opacity: 0.70;
- Filter: progid: DXImageTransform. Microsoft. Alpha (style = 0, opacity = 70, finishOpacity = 100 );
- Width: e-xpression (documentElement. clientWidth <900? (DocumentElement. clientWidth = 0? (Body. clientWidth <900? '200': 'auto'): '900px '): 'auto ');
- }
- # WindowDIV {position: absolute; z-index: 3; background-color: # FFFFFF; border: #000000 solid 1px; display: none ;}
- </Style>
- <Script type = "text/javascript">
- // Hide the drop-down box to solve the problem that the drop-down box has a high priority,
- Function _ displaySelect (){
- Var selects = document. getElementsByTagName ("select"); // all the drop-down boxes on the entire page
- Var objWindow = $ ("WindowDIV ");
- Var DIVselects = objWindow. getElementsByTagName ("select"); // all the drop-down boxes of the entire pop-up layer
- For (var I = 0; I <selects. length; I ++ ){
- If (selects [I]. style. visibility ){
- Selects [I]. style. visibility = "";
- } Else {
- Selects [I]. style. visibility = "hidden ";
- For (var j = 0; I <DIVselects. length; j ++ ){
- DIVselects [j]. style. visibility = "";
- }
- }
- }
- }
- Function openWindows (width, height ){
- Var objWindow = $ ("WindowDIV ");
- Var objLock = $ ("LockWindows"); // This is used to block content in IE.
- ObjLock. style. display = "block ";
- ObjLock. style. width = document. body. clientWidth + "px ";
- ObjLock. style. height = document. body. clientHeight + "px ";
- ObjLock. style. minWidth = document. body. clientWidth + "px ";
- ObjLock. style. minHeight = document. body. clientHeight + "px ";
- // Determine whether the input width and height are greater than the width and height of the current Browser
- If (width> document. body. clientWidth) width = document. body. clientWidth + "px ";
- If (height> document. body. clientHeight) height = document. body. clientHeight + "px ";
- ObjWindow. style. display = 'block ';
- ObjWindow. style. width = width + "px ";
- ObjWindow. style. height = height + "px ";
- // Center the pop-up layer
- ObjWindow. style. left = (document. body. offsetWidth-width)/2 + "px ";
- ObjWindow. style. top = (document. body. offsetHeight-height)/2 + "px ";
- _ DisplaySelect ();
- }
- Function hiddenWindows (){
- $ ("LockWindows"). style. display = 'none ';
- $ ("WindowDIV"). style. display = 'none ';
- _ DisplaySelect ();
- }
- </Script>
- <Div id = "LockWindows"> </div>
- <Div id = "WindowDIV">
- <% @ Include file = "../examination/openEditerDiv. jsp" %>
- </Div>
III,
650) this. width = 650; "border =" 0 "alt =" "src =" http://img1.51cto.com/attachment/201205/191128400.png "/>
This article is from the "Zuo Luo CTO" blog, please be sure to keep this http://zorro.blog.51cto.com/2139862/864888