IE修复:嵌入PNG透明度
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IE修复:嵌入PNG透明度相关的知识,希望对你有一定的参考价值。
This will fix all embeded PNGs.this.src = "img/spacer.gif"
Needs to point to a 1x1 transparent GIF or you'll get an Image not found icon in the corner of the PNGs.
img, .png { position: relative; behavior: expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none", this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')", this.src = "img/spacer.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''), this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')", this.runtimeStyle.backgroundImage = "none")),this.pngSet=true)); }
以上是关于IE修复:嵌入PNG透明度的主要内容,如果未能解决你的问题,请参考以下文章
JavaScript IE 5.5和IE6 PNG透明度修复(需要原型)