Loading| Web pages familiar with Flash's friends know that generally larger flash works should be added loading to prevent its playback is not continuous. In contrast, the Web page is much smaller, but if the speed is very slow, open a 10KB or so of the page time to more than 30 seconds, then it is necessary to add loading.
Loading principle is very simple, add an opaque layer in the Web page, the Z-index property is set to "100", even if it is on the top level is no exception, width, height are set to "100%". The onload event is hidden when the Web page has finished loading. The specific code is as follows:
</title>
<meta http-equiv= "Content-type"
Content= "text/html; charset=gb2312 ">
<body >
<div id= "Loading" style= "position:absolute;width:100%; Height:100%;z-index:100;background:white; " >
<div id= "Waiting" style= "position:absolute;left:40%;top:50%;" ></div></div>
<script>
var text= "Loading document"; i=0;
function Load () {
if (i<6) {
text+= ".";
Waiting.innertext=text;
i++;}
else {text= "loading document"; i=0;}}
Timer=window.setinterval ("Load ()", 300);
</script>
<!--The following are the contents of the Web page .-->
</body>
Ok! Loading is done, try it, but it's worth noting that loading may not work when there are only <script> and <iframe> tags in the document.