裝載後顯示的精靈功能在此請看: Wait for image to be loaded before going on
下面是一個簡單的樣機:
<html>
<head>
<script language="javascript">
function loadImage()
{
var img = new Image();
img.src = 'img_navsprites.gif';
console.log('1. Image has just started downloading.');
document.getElementsByTagName('body')[0].appendChild(img);
img.onload = function() {
console.log('2. Image has fully loaded.');
}
console.log('3. Hey, look at me ... all the way down here!');
}
</script>
</head>
<body onload="loadImage()">
<div>
</div>
</body>
</html>
另一個基於你的代碼的PasteBin模型: http://pastebin.com/wcBY2YaL
i tri編輯但沒有用@Dane Balia – Villan 2012-08-08 04:50:31
任何運氣桑迪? – 2012-08-08 05:00:35
沒有朋友仍在嘗試相同@Dane Baila – Villan 2012-08-08 05:01:42