IE6 中 PNG 透明度问题

发布于 2024-10-04 04:19:36 字数 110 浏览 2 评论 0原文

我知道这是一个有点愚蠢的问题,但我不知道如何在 IE6 中使透明 PNG 工作。我尝试了几件事,但都没有奏效。我想知道是否有人可以让我知道合适的黑客?

提前致谢,

AD72

I know this is a bit of a silly question, but I can't work out how to make a transparent PNG work in IE6. I've tried several things, but they haven't worked. I was wondering if anyone could let me know of a suitable hack?

Thanks in advance,

AD72

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

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

发布评论

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

评论(5

坠似风落 2024-10-11 04:19:36

嘿,使用 jQueries pngFix。效果就像一个魅力! http://jquery.andreaseberhard.de/pngFix/

Hey use jQueries pngFix. Works like a charm! http://jquery.andreaseberhard.de/pngFix/

望笑 2024-10-11 04:19:36

你尝试过这个方法吗? 链接文本

我在 IE6 之前尝试了一些 png hacks,这是解决问题的最好的一个ie 所遇到的 png 的所有问题。祝你好运

have you tried this method? link text

i have tried a number of png hacks fore IE6 and this is the best one that resolves all of the problems that ie has with pngs. good luck

疯狂的代价 2024-10-11 04:19:36

这是我们使用的代码,看起来运行良好。

// from http://labs.unitinteractive.com/unitpngfix.php

var clear="/images/template/clear.gif" //path to clear.gif

pngfix=function(){var els=document.getElementsByTagName('*');var ip=/\.png/i;var i=els.length;while(i-- >0){var el=els[i];var es=el.style;if(el.src&&el.src.match(ip)&&!es.filter){es.height=el.height;es.width=el.width;es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+el.src+"',sizingMethod='crop')";el.src=clear;}else{var elb=el.currentStyle.backgroundImage;if(elb.match(ip)){var path=elb.split('"');var rep=(el.currentStyle.backgroundRepeat=='no-repeat')?'crop':'scale';es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+path[1]+"',sizingMethod='"+rep+"')";es.height=el.clientHeight+'px';es.backgroundImage='none';var elkids=el.getElementsByTagName('*');if (elkids){var j=elkids.length;if(el.currentStyle.position!="absolute")es.position='static';while (j-- >0)if(!elkids[j].style.position)elkids[j].style.position="relative";}}}}}
window.attachEvent('onload',pngfix);

Here's the code we use that seems to work fine.

// from http://labs.unitinteractive.com/unitpngfix.php

var clear="/images/template/clear.gif" //path to clear.gif

pngfix=function(){var els=document.getElementsByTagName('*');var ip=/\.png/i;var i=els.length;while(i-- >0){var el=els[i];var es=el.style;if(el.src&&el.src.match(ip)&&!es.filter){es.height=el.height;es.width=el.width;es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+el.src+"',sizingMethod='crop')";el.src=clear;}else{var elb=el.currentStyle.backgroundImage;if(elb.match(ip)){var path=elb.split('"');var rep=(el.currentStyle.backgroundRepeat=='no-repeat')?'crop':'scale';es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+path[1]+"',sizingMethod='"+rep+"')";es.height=el.clientHeight+'px';es.backgroundImage='none';var elkids=el.getElementsByTagName('*');if (elkids){var j=elkids.length;if(el.currentStyle.position!="absolute")es.position='static';while (j-- >0)if(!elkids[j].style.position)elkids[j].style.position="relative";}}}}}
window.attachEvent('onload',pngfix);
别闹i 2024-10-11 04:19:36

我使用过 TwinHelix 中的一个或上面提到的 jquery 之一。

Ive used the one from TwinHelix or the jquery one mentioned above.

幸福还没到 2024-10-11 04:19:36

PNG 形式的图像是后符号图形,主要在英国维多利亚女王时代的法律中描述,因此主要在英国使用。用于创建和显示 PNG 图像的软件源自英国并受英国保护,所有浏览器所需的不同显示软件版本以及不同的和新的浏览器版本和内容环境可能尚未委托完成,并且不兼容性可能会持续存在于某些浏览器中。时间。最初与 MS 和 IE 浏览器的协议仅用于显示 PNG,并且可能已经为其他浏览器开发了许多非官方的破解和解码,并取得了不同的成功。只有在指定的国家和省份列表中使用时,PNG 才是正式且完全可渲染的。

The PNG form of image is Post Notational Graphic and is primarily described in a law in the era of Queen Victoria of England and therefore is primarily for use in Great Britain. The software for creating and displaying a PNG image is sourced from and protected by England and the different display software versions required for all browsers and different and new browser versions and content environments may not have been commissioned to be done and the incompatibilities could persist for some time. Originally the agreement was with MS and the IE browser only for displaying PNG and it is possible a number of unofficial hacks and decodes have been developed for other browsers with varying success. PNG is officially and completely renderable only when used in a defined list of nations and provinces.

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