JS implementation [loading... please wait ....] Function

Source: Internet
Author: User

The response time obtained from the Message Server is relatively slow during the IM process. At this time, you will feel at ease by displaying dynamic prompts.

 

Start with an effect,

No GIF dynamic images yet. You can think of the actual results ....

 

Okay. Send the source code.

 

<Div id = "lockscreen"> <form name = loading> <TD align = center> <p> <font color = gray> loading, please wait ....... </font> </P> <p> <input type = text name = chart size = 46 style = "font-family: Arial; font-weight: bolder; color: gray; Background-color: White; padding: 0px; border-style: none; "> <br> <input type = text name = percent size = 46 style =" font-family: Arial; color: Gray; text-align: center; border-width: medium; border-style: none; "> <SCRIPT> var bar = 0; var line =" | "; var amount =" | "; count (); function count () {bar = BAR + 2; amount = Amount + line; document. loading. chart. value = amount; document. loading. percent. value = BAR + "%"; if (Bar <99) {setTimeout ("count ()", 80) ;}else {hidescreen ();}} </SCRIPT> </P> </TD> </form> </div> <Div id = "screen" style = "width: auto; "> <Div id =" roster "class =" roster "> </div>

The IDS are lockscreen and screen. The lockscreen is displayed at the beginning, and the sreen content is displayed after loading.

 

// lockScreen dml@2012.9.7function hideScreen() {var Element = document.getElementById('lockScreen');var Elements = document.getElementById('Screen');Element.style.display = 'none';Elements.style.display = '';}

 

This is just a simple function, and the loading time is also estimated. There are still a lot to be optimized. Try again when you are free ....

 

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.