嵌套元素中的 IE 不透明度问题

发布于 2024-10-06 04:06:21 字数 280 浏览 6 评论 0原文

有人找到解决方案吗? http://seanmonstar.com/post/709013028/ie-opacity-ignores -positioned-children

我已经搜索了几个小时但找不到解决方案。我知道 filter:inherit 有效,但我实际上需要过滤器为嵌套元素之一提供不透明度......

Has anybody found a solution for 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…

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

久光 2024-10-13 04:06:21

看一下这个似乎有效的示例: jsfiddle

所以我使用 jquery 来淡入淡出如果删除position:relative;会影响不透明度。来自#toggle_me;你会发现定位元素有问题,所以解决方案是使用position:relative;在父母身上。

同样在 jquery 代码区域中,您将看到 this.style.removeAttribute('filter');当 IE 淡出时,它会奇怪地阻止 IE 渲染文本。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文