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>
<script language="javascript">
function checkStatus()
{
window.status = event.srcElement.readyState !="complete" ? "still downloading..." : "done";
}
</script>
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>
<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>
在每个<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>
你只要用flash做一个就可以的了
那么激动干什么啊!
你不会吗?
找我好了!
http://202.102.4.31/51windows/work/tload.htm