ie7和ie8中的剩余而不是透明,而使用PNG透明和不透明
I am developing a project that uses the PNG transparent and Opacity but, the area has a surplus in IE7 and IE8 instead of being transparent, it is black, can someone help me?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我有一个解决方案,之前在多个网站上使用过。
只需在将 html 内容写入页面后运行此函数即可:
它仅适用于 img 元素,不适用于背景图像。但一旦应用,您就可以淡入淡出图像并根据您的喜好制作动画。我在一些雄心勃勃的动画中经历过一些奇怪的副作用,但 90% 的时间都很好。
希望这对您有帮助!
W.
I have a solution for this, have used on multiple sites before.
Simply run this function after your html content has been written to the page:
It will only work on img elements and not background images. But once applied you can fade in and out images and animate to your hearts content. I have experienced some strange side effect on some ambitious animations but for 90% of the time it's fine.
Hope this helps you!
W.
IE7 和 IE8 支持 PNG 中不同类型的透明度。那边没问题。
您遇到的问题是IE7和IE8不支持CSS不透明度。而且您很可能有一个动态操纵不透明度 (element.style.opacity) 的 JS 脚本,例如产生淡入淡出效果。如果 IE7 和 8 不支持不透明度,脚本如何更改 IE7 和 8 中的 element.style.opacity?它使用 DirectX 过滤器,与您可以使用 CSS 过滤器相同: alpha (opacity = 50);
DirectX 过滤器不是本机支持。结果是它常常会产生副作用。该项目将以部分不透明度显示,不会由图形引擎“普通”浏览器渲染,而是直接由 DirectX 渲染...在某些情况下,CSS 定位上的字体渲染存在差异,并且...支持 PNG 透明度。
解决方案:消除两个参数之一。
IE7 and IE8 support different types of transparency in PNG. No problem on that side.
The problem you meet is IE7 and IE8 does not support CSS opacity. And you most likely have a JS script that manipulates the opacity (element.style.opacity) dynamically, for example to produce a fade effect. And how does the script to change element.style.opacity in IE7 and 8 if they do not support opacity? It uses a DirectX filter in place, the same that you can use CSS filter: alpha (opacity = 50);
DirectX filter is not a native support. The consequence is that often it off with side effects. The item will be displayed with a partial opacity will not be rendered by the graphics engine "normal" browser, but directly by DirectX ... with differences in the rendering of fonts on CSS positioning in some cases, and ... support PNG transparency.
Solution: Eliminate one of two parameters.
需要注意的是,如果不设置 WIDTH,IE7 中的 ALPHA 过滤器将无法工作。
It is important to note that the ALPHA filter in IE7 will not work without also setting the WIDTH.