简体   繁体   English

如何显示加载图像,直到页面正文背景图像加载完毕?

[英]How to show a loading image until the page body background image loaded?

We need to show a loading image until the page large size of background image is loaded. 我们需要显示一个加载图像,直到加载大尺寸背景图像页面为止。 This bg image will be called to body tag in the HTML file not through CSS. 该bg图片将通过HTML文件而不是CSS调用为body标签。

Try this 尝试这个

$(document).ready(function(){
    //Display image here
}


$(window).load(function(){  
    //remove image
});  

So you display an image when the document is ready 这样,当文档准备好时,您可以显示图像

And finally you remove the image when the page is loaded completly 最后,当页面完全加载后,您将删除图像

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM