I'm hoping to set the background of a modal dialog as semi-transparent. This works find in firefox 2 and 3:
however, ie7 chokes on it and fails to complete the function in which that code lives. the e.filters reference appears to be the problem.Code:if (e.filters) { e.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + this.iOpacity + ')'; } else if (e.style) { e.style.opacity = (this.iOpacity/100); } else { alert('Unable to set opacity of modal dialog background.'); }
I have also tried this to no avail:
Can anyone give me a browser-proof means of setting opacity for an HTML element?Code:e.style.opacity = (this.iOpacity / 100); e.style.MozOpacity = (this.iOpacity / 100); e.style.KhtmlOpacity = (this.iOpacity / 100); e.style.filter = "alpha(opacity=" + this.iOpacity + ")";


Reply With Quote

Bookmarks