[英]IMAGE - Substitute for loading images?
I don't know how it's called so google isn't giving me good answers. 我不知道该怎么称呼,所以google不能给我很好的答案。
How do create a replacement image for an image that is yet to be loaded? 如何为尚未加载的图像创建替换图像?
Like when the image size is big, I'd like to replace it with something like "Loading. Please wait" or something while the image is still being loaded and will be displayed once it has completed loading? 就像图像较大时,我想用“正在加载。请稍候”之类的东西替换它,或者在图像仍在加载时将其替换,并在完成加载后显示?
There is a canonical way to do this: 有一种规范的方法可以做到这一点:
<img onload="..." ...>
) replace the DOM node of the placeholder image with the preloaded node. 加载图像后( <img onload="..." ...>
),将占位符图像的DOM节点替换为预加载的节点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.