<!--[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. Google Now 'not available in your country'

    Google Now 'not available in your country' Don't know how to cope with this problem.

  2. AIX安装CDE,CDE服务开启和关闭

    1.将AIX的光盘镜像通过ftp工具上传至/mnt目录下,如下图: 2.创建目录/media作为默认的AIX光盘挂载区 # mkdir /media 3.将AIX的第一张光盘挂载到/media目录下: ...

  3. django2.0集成xadmin0.6报错集锦

    1.django2.0把from django.core.urlresolvers修改成了django.urls 报错如下: 1 2 3   File "D:\Envs\django-xad ...

  4. android Dialog官方demo

    1.普通的Dialog AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage("今天 ...

  5. zookeeper集群-solrcloud集群

    本文只写具体的搭建过程,具体原理请看官网文档.国内博客都是基本上都是通过tomcat搭建的solr,本文是通过内部集成的jetty容器搭建. 一.zookeeper集群搭建 1.安装JAVA环境,版本 ...

  6. 2018 eclipse安装反编译插件

    1.在eclipse的help—>Install New Software...中添加新软件开发,添加它的源:     name:jd-eclipse_update_site address:h ...

  7. pyDay13

    内容来自廖雪峰的官方网站. 1.把list.dict.str等Iterable变成Iterator可以使用iter()函数 >>> L = iter([1, 2, 3, 4, 5, ...

  8. 无界面Ubuntu服务器搭建selenium+chromedriver+VNC运行环境

    搭建背景 有时候我们需要把基于selenium的爬虫放到服务器上跑的时候,就需要这样一套运行环境,其中VNC是虚拟的显示模式,用于排查定位线上问题以及实时运行情况. 搭建流程 安装虚拟输出设备:sud ...

  9. P3327/bzoj3994 [SDOI2015]约数个数和(莫比乌斯反演)

    P3327 [SDOI2015]约数个数和 神犇题解(转) 无话可补 #include<iostream> #include<cstdio> #include<cstri ...

  10. 20145319 return-to-libc攻击实验

    20145319 Return-to-libc攻击实验 一 实验内容 return-to-libc实验是一个基于缓冲区溢出攻击实验的基础上的一种攻击实验 缓冲区溢出攻击相关知识: 原理:通过一段包含s ...