A cool page load effect code

Source: Internet
Author: User
Tags filter visibility
Comparison | effects | page Add the following code to the <script src= "Js/loadbar.js" type= "Text/javascript" ></script>

The loadbar.js code is as follows
function Loadbar (FL)
FL is show/hide flag
{
var x,y;
if (self.innerheight)
{//All except Explorer
x = Self.innerwidth;
y = self.innerheight;
}
Else
if (document.documentelement && document.documentElement.clientHeight)
{//Explorer 6 Strict Mode
x = Document.documentElement.clientWidth;
y = document.documentElement.clientHeight;
}
Else
if (document.body)
{//other explorers
x = Document.body.clientWidth;
y = document.body.clientHeight;
}

var El=document.getelementbyid (' loader ');
if (Null!=el)
{
var top = (Y/2)-50;
var left = (X/2)-150;
if (left<=0) left = 10;
El.style.visibility = (fl==1)? ' Visible ': ' Hidden ';
El.style.display = (fl==1)? ' Block ': ' None ';
El.style.left = left + "px"
El.style.top = top + "px";
El.style.zIndex = 2;
}
}

Add the following code to the <body></body> area
<body >
<div id= "Loader" >
<table class= "loader" style= "Filter:alpha (opacity=75)" cellspacing= "1" cellpadding= "5" bgcolor= "#bbbbb" border= "0 ">
<tbody><tr>
&LT;TD align= "left" bgcolor= "#ffffff" >
<p><strong> data loading ... </strong><br/>
<span> loading page, please wait ...</span></p></td></tr>
</tbody></table>
</div>
<script language= "JavaScript" type= "Text/javascript" >loadbar (1);</script>

Attached wait.gif pictures ....

<pead><script type= "Text/javascript" >function Loadbar (fl)//FL is show/hide flag{var x,y; if (self.innerheight) {//all except Explorer x = Self.innerwidth; y = self.innerheight; else if (document.documentelement && document.documentElement.clientHeight) {//Explorer 6 Strict Mode x = Document.documentElement.clientWidth; y = document.documentElement.clientHeight; else if (document.body) {//other explorers x = Document.body.clientWidth; y = document.body.clientHeight; } var El=document.getelementbyid (' loader '); if (Null!=el) {var top = (Y/2)-50; var left = (X/2)-150; if (left<=0) left = 10; El.style.visibility = (fl==1)? ' Visible ': ' Hidden '; El.style.display = (fl==1)? ' Block ': ' None '; El.style.left = left + "px" el.style.top = top + "px"; El.style.zIndex = 2; }}</script></pead> <body><body ><div id= "loader" ><table class= "loader" style= "Filter:alpha (opacity=75)" cellspacing= "1" cellpadding= "5" bgcolor= "#bbbbb" border= "0" ><tbody><tr> <td align= "left" bgcolor= " #ffffff "> <p><strong> data loading ... </strong><br/> <span> loading page, please wait ... </span></p ></td></tr></tbody></table></div><script language= "JavaScript" type= "text/ JavaScript ">loadbar (1);</script></body>

[Ctrl + A ALL SELECT hint: You can modify some of the code, and then run]



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.