1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > css png有白背景图片 透明背景的PNG格式图片在IE显示白色背景的问题(等)...

css png有白背景图片 透明背景的PNG格式图片在IE显示白色背景的问题(等)...

时间:2024-01-23 08:09:43

相关推荐

css png有白背景图片 透明背景的PNG格式图片在IE显示白色背景的问题(等)...

该楼层疑似违规已被系统折叠隐藏此楼查看此楼

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.

{

var arVersion = navigator.appVersion.split("MSIE")

var version = parseFloat(arVersion[1])

if ((version >= 5.5) && (document.body.filters))

{

for(var j=0; j

{

var img = document.images[j]

var imgName = img.src.toUpperCase()

if (imgName.substring(imgName.length-3, imgName.length) == "PNG")

{

var imgID = (img.id) ? "id='" + img.id + "' " : ""

var imgClass = (img.className) ? "class='" + img.className + "' " : ""

var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "

var imgStyle = "display:inline-block;" + img.style.cssText

if (img.align == "left") imgStyle = "float:left;" + imgStyle

if (img.align == "right") imgStyle = "float:right;" + imgStyle

if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle

var strNewHTML = "

+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"

+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"

+ "(src=\'" + img.src + "\', sizingMethod='scale');\">

"

img.outerHTML = strNewHTML

j = j-1

}

}

}

}

window.attachEvent("onload", correctPNG);

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。