0

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?

Tuomas Toivonen
  • 21,690
  • 47
  • 129
  • 225

2 Answers2

0

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)
Olivier Boissé
  • 15,834
  • 6
  • 38
  • 56
0

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 */
libertyernie
  • 2,590
  • 1
  • 17
  • 13