简体   繁体   中英

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?

<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.

How to get this working in IE?

rgba and background-color doesn't seem to work in 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.

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 */

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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