简体   繁体   English

在Internet Explorer 8中创建HTML模式窗口

[英]Creating HTML modal window in Internet Explorer 8

How to create modal window in Internet Explorer 8 which grays out the whole screen and shows ajax spinner? 如何在Internet Explorer 8中创建模态窗口,使整个屏幕变灰并显示ajax微调器?

<div style="display: none; position: fixed; z-index: 1000; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0, 0.4)">

Following div works fine Edge, but doesn't gray out the screen in IE8 and let's user interact with the page. 跟随div可以很好地处理Edge,但是不会使IE8中的屏幕变灰,而是让用户与页面进行交互。

How to get this working in IE? 如何使它在IE中工作?

rgba and background-color doesn't seem to work in IE 8 caniuse_rgba caniuse_background-color rgba和background-color似乎在IE 8中不起作用 caniuse_rgba caniuse_background-color

You can use background with a fallback 您可以使用背景进行后备

background: #EEE /* The Fallback */
background: rgba(0,0,0, 0.4)

IE 8 does not support opacity in the same way newer browsers do, but you can do it using the old Microsoft filter attribute. IE 8不像更新的浏览器那样支持不透明度,但是您可以使用旧的Microsoft过滤器属性来实现。

See if this works for you: 看看这是否适合您:

background-color: rgba(0,0,0);
opacity: 0.4; /* Newer browsers */
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=40); /* IE8 */

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

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