开发者

IE Opacity Problem in Nested Elements

开发者 https://www.devze.com 2023-01-29 12:32 出处:网络
Has anybody found a solution for开发者_JS百科 this ? http://seanmonstar.com/post/709013028/ie-opacity-ignores-positioned-children

Has anybody found a solution for开发者_JS百科 this ? http://seanmonstar.com/post/709013028/ie-opacity-ignores-positioned-children

I’ve been searching for hours now and can’t find a fix. I know that filter:inherit works but I actually need the filter to give opacity to one of the nested elements…


Look at this example which seems to work: jsfiddle

So I'm using jquery to fade in and out which effects the opacity, if you remove position:relative; from #toggle_me; you'll find the positioned element has an issue, so the solution is to have position:relative; on the parent.

Also in the jquery area of code you'll see this.style.removeAttribute('filter'); that stops IE strangely rendering the text when it fades back up.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号