您好,欢迎访问一九零五行业门户网

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

复制代码 代码如下:
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);
其它类似信息

推荐信息