I do not think the DOM provides information on how much the image is downloaded, the best you can do is to check its status, like this:<img src="http://www.fawcette.com/vsm/images/logo_vsm.gif" onreadystatechange="checkStatus()">
<script language="javascript">
function checkStatus()
{
  window.status = event.srcElement.readyState !="complete" ? "still downloading..." : "done";
}
</script>

解决方案 »

  1.   

    <BODY><OBJECT id=pb style="WIDTH: 515px; HEIGHT: 50px" 
    classid=clsid:0713E8D2-850A-101B-AFC0-4210102A8DA7 VIEWASTEXT><PARAM NAME="_ExtentX" VALUE="13626"><PARAM NAME="_ExtentY" VALUE="1323"><PARAM NAME="_Version" VALUE="327682"><PARAM NAME="BorderStyle" VALUE="0"><PARAM NAME="Appearance" VALUE="1"><PARAM NAME="MousePointer" VALUE="0"><PARAM NAME="Enabled" VALUE="1"><PARAM NAME="OLEDropMode" VALUE="0"><PARAM NAME="Min" VALUE="0"><PARAM NAME="Max" VALUE="100"></OBJECT>
    <script>function ch(a)
    {
    pb.Value = a++;
    setTimeout("ch("+a+")",100);
    }
    ch(0);</script></BODY>
      

  2.   

    我只能通过,fileSize得到整个文件的大小,我看到了很多进度条的例子,大多是在文件load时模糊的显示进度,并不准确,javascript有没有提供关于得到image大小的方法,不是images.length。
      

  3.   

    把如下代码加入到<body>区域中<form name=loading>
      <p align=center> <font color="#0066ff" size="2" face="Arial">载入中,请稍等...</font><br>
        <input type=text name=chart size=46 style="font-family:Arial; font-weight:bolder; color:#0066ff; background-color:#fef4d9; padding:0px; border-style:none;">
        <br>
        <input type=text name=percent size=47 style="color:#0066ff; text-align:center; border-width:medium; border-style:none;">
        <script> 
    var bar=0 
    var line="||" 
    var amount="||" 
    count() 
    function count(){ 
    bar=bar+2 
    amount =amount + line 
    document.loading.chart.value=amount 
    document.loading.percent.value=bar+"%" 
    if (bar<99) 
    {setTimeout("count()",100);} 
    else 
    {window.location = "#";} 
    }</script>
      </p>
    </form>
      

  4.   

    对单个图片可怕很难。对多图,可以这样:
    在每个<img onload="test()">下载后,更新显示的数据。
    <img onload="test(1)">
    <img onload="test(2)">
    <img onload="test(3)">
    <script>
    function test(a)
    {
    switch(a)
    {
    case 1:
    window.status="下载了30%"
    break;
    case 2:
    window.status="下载了60%"
    break;
    case 3:
    window.status="下载了100%"
    break;
    }
    }
    </script>
      

  5.   

    其实不用那么麻烦的
    你只要用flash做一个就可以的了
    那么激动干什么啊!
    你不会吗?
    找我好了!
      

  6.   

    看看我写的这个!
    http://202.102.4.31/51windows/work/tload.htm