<style type="text/css">
/* Container of Loader */
#seLoader
{
width : 200px; /* set width of loader */
z-index : 1;
margin : auto;
}/* Box around loadbar */
#seLoadBox
{
height : 14px; /* set height */
z-index : 3;
border : 1px solid;
padding : 1px;
background-color : #efefef;
font-size : 0px;
text-align : left;
        border-color: #678fcd
}/* loadbar */
#seLoadBar
{
width : 0%;
height : 100%;
z-index : 4;
background : #678fcd;
}/* text (%) */
#seLoadTxt
{
z-index : 5;
margin-top : -14px;
font : 10px Verdana,Geneva,sans-serif;
        color: #ffffff
}
</style>
<script language="javascript">
function seLoader(imgRoot)
{
this.root = imgRoot||''
this.runAt = 0
this.preImg = new Array()
this.done = 0
this.f = 0
this.to = 0
eval(this.obj + '=this')
}
seLoader.prototype.runAtEnd = function(fct)
{
this.runAt = fct
}
seLoader.prototype.setImgs = function()
{
this.imgs = arguments
}
seLoader.prototype.load = function()
{
this.loadTxt = document.getElementById('seLoadTxt')
this.bar = document.getElementById('seLoadBar').style
for(i=0;(this.imgs[i]);i++)
{
this.preImg[i] = new Image()
this.preImg[i].src = this.imgs[i].indexOf('http')==-1 ? this.root + this.imgs[i] : this.imgs[i]
}
this.checkLoad()

}
seLoader.prototype.drawLoader = function(preTxt)
{
this.startTxt = preTxt ? preTxt : ''
document.writeln('<div id="seLoader"><div id="seLoadBox"><div id="seLoadBar"></div></div><div id="seLoadTxt">' + (this.startTxt!=''?this.startTxt:'0%') + '</div></div>')
}
seLoader.prototype.checkLoad = function()
{
for(i in this.preImg)
{
if(this.preImg[i].complete)
{
this.f = new Number(i)
this.f++
this.bar.width = Math.round(this.f/this.preImg.length*100) + '%'
this.loadTxt.innerHTML = new String(this.startTxt+this.bar.width)
status = this.preImg[i].src + ' loaded'
}
}
if(this.f!=this.preImg.length)
{
clearTimeout(this.to)
this.to = setTimeout(this.obj+'.checkLoad()',25)
}
else
{
status = this.imgs.length + ' images loaded.'
if(this.runAt) eval(this.runAt)
}
}</script>
<script type="text/javascript">
load = new seLoader('images/') // make loader object and set the directory (dir optional)
load.runAtEnd('setTimeout(\'viewPage()\',10)') // run a script after loading (optional)
load.setImgs // set the images
(
'bg.jpg','killerj_r1_c1.jpg','killerj_r1_c2.jpg','killerj_r1_c3.jpg','killerj_r1_c4.jpg','killerj_r1_c5.jpg','killerj_r1_c6.jpg','killerj_r1_c7.jpg','killerj_r1_c8.jpg','biaoxiang-s.jpg','cahust.jpg','gongye-s.jpg','jixiang.jpg','nv1-s.jpg','nv2-s.jpg','shifang-s.jpg','shubiaoche-s.jpg','xitiqin-s.jpg','xitong1-s.jpg','xitong2-s.jpg','xitong3-s.jpg','xitong4-s.jpg','bgbg.gif','bgbgbg.gif')function viewPage()
{
setTimeout("woyingjie()",0)
location.replace('main.asp')
}function initLoader()
{
load.load()
}
onload=initLoader
function woyingjie(){
window.open("close.htm","bannerpopup","width=1,height=1")

}</script>
<body background="images/bg.jpg" style="OVERFLOW-Y: hidden; OVERFLOW-X: hidden; OVERFLOW: scroll">
<table width="50%" height="70%" border="0">
    <tr> 
      <td  align=center class="alpha">
          <font color=#ffffff size=2>66.7 k</font>
          <script>load.drawLoader('now loading . . .')</script>
      </td> 
    </tr>
</table>演示地址:http://killerj.tk   http://www.woyingjie.tk

解决方案 »

  1.   

    <script language="VBScript">
    <!--
    Dim Bar, Line, SP
    Bar = 0
    Line = "|"
    SP = 100
    Function Window_onLoad()
    Bar = 95
    SP = 10
    End Function
    Function Count()
    If Bar < 100 Then
    Bar = Bar + 1
    Window.Status = "页面载入状态:" & Bar & "%" & " " & String(Bar, Line)
    setTimeout "Count()", SP
    Else
    Window.Status = "完毕"
    Document.Body.Style.Display = ""
    End If
    End Function
    Call Count()
    -->
    </script>
      

  2.   

    JS做的LOAD 统统都是假的。~~~~~~~~~~~~~
      

  3.   

    你根据你的网页要调用的所有外部文件,以及该网页本身,将它们的文件大小字节数存到你的页面js中,已明确总字节数和每个文件字节数,然后对每一个要调用外部文件的元素应用onload事件处理,也对该页面做onload处理,这样就能用js计算确切下载了多少字节了。我认为这是一个可以实现的方法,但是麻烦一点。如果是asp页面的话,可以在服务端做些处理,这样就可以简化了。