仅在页面提交后显示具有透明背景的加载图像

only show loading image with a transparent back ground in after page submit

本文关键字:透明 背景 图像 加载 显示 提交      更新时间:2023-09-26

我想在页面提交后显示加载图像。我希望它像,在页面中间加载图像显示,它应该有一个透明的背景来显示页面内容。我用过以下

    #loading {
    position:fixed;
    top:50%;
    left:50%;
    z-index:1104;
    background-color:#999999;
    width:100%;
    height:100%;
    }

请不要在答案中包含javascript部分,我只想知道样式。

这不会为整个页面提供背景颜色。请帮助如何在页面中心显示加载图像,并且页面内容应该略微显示。

谢谢

假设您要禁用与正在加载的内容的所有交互,您可以简单地覆盖元素并将其背景居中:

#overlay { 
    /*Cover the entire screen regardless of scrolling*/ 
    position:fixed;top:0;right:0;bottom:0;left:0; 
    background: #ff0000 url(...) no-repeat 50% 50%; 
}

弄半透明的bgcolor用于演示目的。

编辑:实际上在垂直和水平方向上居中元素是困难的。

删除顶部:50% 和左侧:50%;

http://jsfiddle.net/qqncv/1/