我已经在网页背景中使用了图片。现在我想要的是,在加载整个图像之后,应该在同一文档上记录文本。为此,到目前为止,我已经完成了以下操作:-
<body onload = "myFunction()">
<script>
function myFunction() {
setTimeout(function(){ document.write("<h1>H"); }, 1000);
setTimeout(function(){ document.write("E"); }, 2000);
setTimeout(function(){ document.write("L"); }, 3000);
setTimeout(function(){ document.write("L"); }, 4000);
setTimeout(function(){ document.write("O</h1>"); }, 5000);
}
</script>
</body>
上面的方法在没有图像的情况下也可以正常工作,但是在应用于图像时根本不会加载。
尝试在正文标签中使用图像属性