[英]only show loading image with a transparent back ground in after page submit
I want to show a loading image after page submit. 我想在页面提交后显示加载图像。 I want it to be like , loading image show in the middle of the page and it should have a transparent background to show the page content.
我希望它像一样,加载显示在页面中间的图像,并且它应该具有透明的背景来显示页面内容。 I have used following
我已经使用以下
#loading {
position:fixed;
top:50%;
left:50%;
z-index:1104;
background-color:#999999;
width:100%;
height:100%;
}
Please dont include the javascript part in the answer, I only want to know about styling. 请不要在答案中包含javascript部分,我只想了解样式。
This is not giving background color to the whole page. 这不会给整个页面提供背景色。 Please help how can I show a loading image at center of the page and the page content should slightly show.
请帮助我如何在页面中心显示加载图像,页面内容应略显。
THanks 谢谢
Remove top:50% & left:50%; 移除顶部:50%,左侧:50%;
Assuming that you want to disable all interactions with content being loaded, you could simply overlay the element and center its background : 假设您要禁用所有与正在加载的内容的交互,则可以简单地覆盖元素并将其背景居中:
#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%;
}
Fiddled with a semitransparent bgcolor for demo purposes. 摆弄半透明的bgcolor进行演示。
Edit: actually centering an element both vertically and horizontally is hard . 编辑:实际上将元素垂直和水平居中都很难 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.