Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<TITLE>JS implementation of the picture preload after loading action </title>
<style type= "Text/css" >
<!--
*html{
margin:0;
padding:0;
border:0;
}
body{border:1px solid #f3f3f3; background: #fefefe}
div#loading{
width:950px;
height:265px;
line-height:265px;
Overflow:hidden;
position:relative;
Text-align:center;
}
Div#loading p{
position:static;
+position:absolute;
top:50%;
Vertical-align:middle;
}
Div#loading P img{
position:static;
+position:relative;
top:-50%;left:-50%;
Vertical-align:middle
}
-->
</style>
<div id= "Loading" >
<p></p>
</div>
<script>
var i=0;
var c=3;
var imgarr=new Array
Imgarr[0]= "Yun_qi_img/baidu_logo.gif";
Imgarr[1]= "Yun_qi_img/logo-img.gif";
Imgarr[2]= "Yun_qi_img/logo-zhidao.gif";
var browser=new Object ();
Browser.useragent=window.navigator.useragent.tolowercase ();
Browser.ie=/msie/.test (browser.useragent);
Browser.moz=/gecko/.test (browser.useragent);
function Simage (url,callback)
{
var img = new Image ();
if (browser.ie) {
Img.onreadystatechange =function () {
if (img.readystate== "Complete" | | img.readystate== "Loaded") {
ii=i+1;
callback (i);
}
}
}else if (Browser.moz) {
Img.onload=function () {
if (img.complete==true) {
ii=i+1;
callback (i);
}
}
}
Img.src=url;
}
function Icall (v)
{
if (v<c) {
Simage ("" +imgarr[v]+ "", Icall);
}
else if (v>=c) {
i=0;
Location.replace (' banner.html '); Write your own action here,
}
}