Implement "Please wait ..."

Source: Internet
Author: User

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

 

 
 
  1. // Make the specified DIV always display in the center of the screen
  2. Function letDivCenter (divName ){
  3. Var top = ($ (window). height ()-$ (divName). height ()/2;
  4. Var left = ($ (window). width ()-$ (divName). width ()/2;
  5. Var scrollTop = $ (document). scrollTop ();
  6. Var scrollLeft = $ (document). scrollLeft ();
  7. Detail (divname).css ({position: 'absolute ', 'top': top + scrollTop, left: left + scrollLeft}). show ();
  8. }

Ii. Set the mask Layer


 

 
 
  1. <Style type = "text/css">
  2. # LockWindows {
  3. Position: absolute; top: 10px; left: 10px; background-color: #777777; z-index: 2; display: none;
  4. /* Use the private property of Moz Family-moz-opacity: 0.70 */
  5. /* Use private attribute filter for IE */
  6. /* The standard attribute opacity supports the CSS 3 browser FF 1.5 )*/
  7. Opacity: 0.70;
  8. Filter: progid: DXImageTransform. Microsoft. Alpha (style = 0, opacity = 70, finishOpacity = 100 );
  9. Width: e-xpression (documentElement. clientWidth <900? (DocumentElement. clientWidth = 0? (Body. clientWidth <900? '200': 'auto'): '900px '): 'auto ');
  10. }
  11. # WindowDIV {position: absolute; z-index: 3; background-color: # FFFFFF; border: #000000 solid 1px; display: none ;}
  12. </Style>

 

 
 
  1. <Script type = "text/javascript">
  2. // Hide the drop-down box to solve the problem that the drop-down box has a high priority,
  3. Function _ displaySelect (){
  4. Var selects = document. getElementsByTagName ("select"); // all the drop-down boxes on the entire page
  5. Var objWindow = $ ("WindowDIV ");
  6. Var DIVselects = objWindow. getElementsByTagName ("select"); // all the drop-down boxes of the entire pop-up layer
  7. For (var I = 0; I <selects. length; I ++ ){
  8. If (selects [I]. style. visibility ){
  9. Selects [I]. style. visibility = "";
  10. } Else {
  11. Selects [I]. style. visibility = "hidden ";
  12. For (var j = 0; I <DIVselects. length; j ++ ){
  13. DIVselects [j]. style. visibility = "";
  14. }
  15. }
  16. }
  17. }
  18. Function openWindows (width, height ){
  19. Var objWindow = $ ("WindowDIV ");
  20. Var objLock = $ ("LockWindows"); // This is used to block content in IE.
  21. ObjLock. style. display = "block ";
  22. ObjLock. style. width = document. body. clientWidth + "px ";
  23. ObjLock. style. height = document. body. clientHeight + "px ";
  24. ObjLock. style. minWidth = document. body. clientWidth + "px ";
  25. ObjLock. style. minHeight = document. body. clientHeight + "px ";
  26. // Determine whether the input width and height are greater than the width and height of the current Browser
  27. If (width> document. body. clientWidth) width = document. body. clientWidth + "px ";
  28. If (height> document. body. clientHeight) height = document. body. clientHeight + "px ";
  29. ObjWindow. style. display = 'block ';
  30. ObjWindow. style. width = width + "px ";
  31. ObjWindow. style. height = height + "px ";
  32. // Center the pop-up layer
  33. ObjWindow. style. left = (document. body. offsetWidth-width)/2 + "px ";
  34. ObjWindow. style. top = (document. body. offsetHeight-height)/2 + "px ";
  35. _ DisplaySelect ();
  36. }
  37. Function hiddenWindows (){
  38. $ ("LockWindows"). style. display = 'none ';
  39. $ ("WindowDIV"). style. display = 'none ';
  40. _ DisplaySelect ();
  41. }
  42. </Script>
  43. <Div id = "LockWindows"> </div>
  44. <Div id = "WindowDIV">
  45. <% @ Include file = "../examination/openEditerDiv. jsp" %>
  46. </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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.