<!--[if IE 6]>
<script type="text/javascript">
function correctPNG() {
for (var i = 0; i < document.images.length; i++) {
var img = document.images[i];
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;
i = i - 1;
}
}
}
var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
reIE.test(navigator.userAgent);
var fIEVersion = parseFloat(RegExp["$1"]);
if (fIEVersion < 7) {
window.attachEvent("onload", correctPNG);
}
</script>
<![endif]-->

解决IE6中img标签 图片透明的更多相关文章

  1. IE6中png背景图片透明的最好处理方法

    在IE6浏览器下png(24位)的图片显示是不能透明的. 1.处理办法就是用DDPngMin.js <!--[if IE 6]> <script src="js/DDPng ...

  2. 解决PNG图片在IE6中背景不透明方法_解决IE6中PNG背

    解决PNG图片在IE6中背景不透明方法_解决IE6中PNG背   目录 解决代码 解决png图片在html中 解决png作为网页背景-css 1.解决PNG图片在IE6中背景不透明的CSS与JS代码 ...

  3. 解决iOS中 tabBarItem设置图片(image+title切图在一起)时造成的图片向上偏移

    解决iOS中 tabBarItem设置图片(image+title切图在一起)时造成的图片向上偏移 解决办法1:设置tabBarItem的imageInsets属性 代码示例: childContro ...

  4. 解决struts2中UI标签出现的问题: The Struts dispatcher cannot be found

    解决struts2中UI标签出现的问题: The Struts dispatcher cannot be found 异常信息: The Struts dispatcher cannot be fou ...

  5. 解决html5中video标签无法播放mp4问题的办法

    这篇文章主要给大家介绍了关于解决html5中video标签无法播放mp4问题的办法,文中介绍的非常详细,相信会对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面来一起看看吧. 最近发现了一个 ...

  6. 解决IE6中 PNG图片透明的终极方案-八种方案!

    “珍惜生命,远离IE6”,IE6中的bug令很多Web前端开发人员实为头疼,因此不知道烧了多少脑细胞,在众多的Bug中最令人抓狂的就是IE对png图片的不支持,导致设计师和重构师放弃了很多很炫的效果, ...

  7. 解决ie6中png图片格式不兼容问题

    在IE6中对图片格式png24支持度不高,如果使用的图片格式是png24,则会导致透明效果无法正常显示 解决方法: 1.可以使用png8来代替png24,即可解决问题,但是使用png8代替png24以 ...

  8. png-24在ie6中的几种透明方法

    转载 http://www.cnblogs.com/jikey/archive/2013/03/13/2957168.html 由于游戏类官网在页面背景和装饰人物的设计上追求画丽且与游戏风格想匹配,这 ...

  9. 解决IE6中ajax ‘aborted’错误请求中断

    给a标签绑定了一个click事件用来触发ajax请求,在IE6中,请求时常会被中断,在其他浏览器中都一切正常. 在IE6中使用Fiddler2和httpWatch监视请求,经常会出现”aborted” ...

随机推荐

  1. Oracle性能优化之Oracle里的统计信息

    一.什么是统计信息 oracle数据库里的统计信息是如下的一组数据:他们存储在数据字典里,且从多个维度描述了oracle数据库数据对象的详细信息. oracle数据库里的统计信息主要分为以下6种情况: ...

  2. acceptorThreadCount

    Apache Tomcat 7 Configuration Reference (7.0.92) - The HTTP Connector https://tomcat.apache.org/tomc ...

  3. Python开发【Django】:ModelForm操作

    ModelForm 内容回顾: Model - 数据库操作 - 验证 class A(MOdel): user = email = pwd = Form class LoginForm(Form): ...

  4. arc 和 非arc兼容

    1,选择项目中的Targets,选中你所要操作的Target, 2,选Build Phases,在其中Complie Sources中选择需要ARC的文件双击, 并在输入框中输入:-fobjc-arc ...

  5. 需求:过滤下面这个网页里共723行 校对中里 行数为两位数的 行 并设置sz和rz在Windows和Linux之间发送和接收文件不用搭FTP

    需求:过滤下面这个网页里共723行 校对中里 行数为两位数的 行 并设置sz和rz在Windows和Linux之间发送和接收文件不用搭FTP 需求:过滤下面这个网页里共723行 校对中里 行数为两位数 ...

  6. LockSupport HotSpot里park/unpark的实现

    每个java线程都有一个Parker实例,Parker类是这样定义的: class Parker : public os::PlatformParker { private: volatile int ...

  7. golang 复制对象的正确做法

    需求 实际运用种,传参是一对象指针,现在如何最简便地复制一对象? 实现 坑:&*  先拿到值再指针? package main import ( "time" " ...

  8. t检验&z检验学习[转载]

    转自:https://blog.csdn.net/m0_37777649/article/details/74937242 1.什么是T检验? T检验是假设检验的一种,又叫student t检验(St ...

  9. oracle 查询按月份分组

    如下表table1: 日期(exportDate)               数量(amount) --------------                    ----------- 14- ...

  10. jQuery事件-div的显示隐藏及鼠标的移入移出

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...