Js waiting for loading effect

Source: Internet
Author: User

You can run the instance directly to view the results. Convenient and convenient

[Html]
<Html>
<Head>
<Meta http-equiv = "content-Type" content = "text/html; charset = gb2312">
<Style type = "text/css">
<! --
* {Margin: 0; padding: 0 ;}
. Ifr_div {width: 600px; height: 600px; position: relative ;}
. Ifr_div img {vertical-align: middle ;}
. Proccess {border: 0px solid; border-color: #009900; height: 600px; line-height: 600px; width: 600px; text-align: center; background: # eee; margin: 0; position: absolute; top: 0; left: 0 ;}
. Proccess B {vertical-align: middle; background: url (http://ok22.org/upload/images/20110902143538381.gif) no-repeat 0 center; padding-left: 35px; display: inline-block ;}
-->
</Style>
</Head>
<Body>
<Div class = "ifr_div">
<Div class = "proccess" id = "loading"> <B> loading... </B> </div>
<Iframe id = "sfa" name = "sfa" frameborder = "0" scrolling = "auto" height = "600" width = "600"> </iframe>
</Div>
<Script language = "JavaScript">
Var iframe = document. getElementById ("sfa ");
Iframe. src = "http://www.ok22.org ";
If (iframe. attachEvent ){
Iframe. attachEvent ("onload", function (){
Document. getElementById ("loading"). style. display = "none ";
});
} Else {www.2cto.com
Iframe. onload = function (){
Document. getElementById ("loading"). style. display = "none ";
};
}
</Script>
</Body>
</Html>

Author: junmoxie

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.