js png图片(有含有透明)在IE6中为什么不透明了


复制代码 代码如下:

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 < document.images.length; 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 = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
j = j - 1
}
}
}
}
window.attachEvent("onload", correctPNG);



相关阅读:
asp.net 页面输出缓存
利用ASP发送和接收XML数据的处理方法与代码
html 到 pdf的转换
CSS 清除浮动元素方法 整理
让IIS支持PHP
用Jquery访问WebService并返回Json的代码
PHP中参数引用返回的实例
全面理解javascript的caller,callee,call,apply概念
PHP开发中常用的8个小技巧
PHP转换IP地址到真实地址
分清ASP.NET AJAX中的Extender和Behavior模型
Win Server 2008驱动安装全攻略
WEB标准心得之网页重构的思路
ASP教程:ASP基础语法
快速导航

Copyright © 2016 phpStudy | 皖ICP备18014864号-4