<script type='text/javascript' src="/script/ie6.pngfix.js"></script>

会让一些position的图片位置错乱

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);
}

------------------------------------------------------------------------------

只解决ie6中 background url的不透明问题

<script src="iepng.js" type="text/javascript"></script>

<script type="text/javascript">
   EvPNG.fix('div,ul,img,li,input,span,b,h1,h2,h3,h4,a');
</script>

IE6 PNG不透明问题 (只解决img标签的图片)的更多相关文章

  1. fontsize可以解决img标签插入图片之间的缝隙

    当我们用img标签连续插入多张图片的时候,图片和图片之间会出现缝隙,通常我们的做法是用DIV将图片包起来进行浮动来解决这个问题,但是还有一种解决方法是在img的父级元素里面设置font-size:0来 ...

  2. IE6 png 透明 (三种解决方法)

    FF和IE7已经直接支持透明的png图了,下面这个主要是解决IE6下透明PNG图片有灰底的 ====================================================== ...

  3. (转)解决png图片在IE6下不透明的方法

    来源于:http://xzl52199.blog.163.com/blog/static/95206446201142174540220/ 一.传统的JavaScript方法 思路: 1.一个专门解决 ...

  4. IE6 png 透明 (三种解决方法)(转来的哦)

    FF和IE7已经直接支持透明的png图了,下面这个主要是解决IE6下透明PNG图片有灰底的 ====================================================== ...

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

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

  6. ie6背景透明的设置方法 ie6背景颜色透明和png图像透明解决方法

    IE6浏览器,让我们又爱又恨.爱它的是,可以让我们写的代码的时候,可以更标准,恨的是,它有太多无厘头的IE6常见bug(详情点击),让我们焦头烂额.现在现在用百度浏览器调查,国内占有率不到6%了,但是 ...

  7. IEPNGFix 解决IE6支持PNG透明问题

    IE6本身是支持索引色透明度(PNG8)格式,但不支持真彩色透明度(PNG24)格式. 使用IE PNG Fix 2.0可以完美解决IE6支持PNG透明问题,而且支持背景定位和重复属性. IE PNG ...

  8. 解决IE6下PNG透明的JS插件:DD_belatedPNG.js

    DD_belatedPNG是一款解决IE6下PNG透明的JS插件,支持background-position和background-repeat属性,支持伪类.使用方法: <!--[if lte ...

  9. ie6,ie7,ie8 css bug兼容解决记录

    ie6,ie7,ie8 css bug兼容解决记录 转载自:ie6,ie7,ie8 css bug兼容解决记录 - 前端开发 断断续续的在开发过程中收集了好多的bug以及其解决的办法,都在这个文章里面 ...

随机推荐

  1. Maven下载cxf所需要的jar包

    <dependency> <groupId>org.codehaus.woodstox</groupId> <artifactId>woodstox-c ...

  2. C# 在引用插件中 出现的问题| Csharp cite the plugin problem

    背景:使用C#操纵鼠标进行重复性的工作 background: using Csharp to handle the keyboard or mouse to do the repetitive wo ...

  3. 用Keras搭建神经网络 简单模版(三)—— CNN 卷积神经网络(手写数字图片识别)

    # -*- coding: utf-8 -*- import numpy as np np.random.seed(1337) #for reproducibility再现性 from keras.d ...

  4. html5 progress样式修改

    CSS代码: .deal progress { -webkit-appearance: none; } .deal ::-webkit-progress-inner-element { } .deal ...

  5. H-Index II @python

    Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize ...

  6. s3express截图安装教程

    1.安装s3express_setup.exe 2.设置s3express 设置服务器地址setopt -endpoint:s3.cn-north-1.amazonaws.com.cn 设置协议set ...

  7. linux下一个监测进程CPU和MEM使用率的shell脚本

    #!/bin/bashPID=$1 cpu=`ps --no-heading --pid=$PID -o pcpu`mem=`ps --no-heading --pid=$PID -o pmem`ec ...

  8. 试讲DOCKER专用

    内容概要: DOCKER简介 为什么要用DOCKER DOCKER的应用场景 DOCKER基础 一 DOCKER简介 Docker是Docker.Inc公司开源的一个基于轻量级虚拟化技术的容器引擎项目 ...

  9. (转)linux查找技巧: find grep xargs

    在当前目录下所有.cpp文件中查找efg函数 find . -name "*.cpp" | xargs grep 'efg' xargs展开find获得的结果,使其作为grep的参 ...

  10. 双向链表-java完全解析

    原文:https://blog.csdn.net/nzfxx/article/details/51728516 "双向链表"-数据结构算法-之通俗易懂,完全解析 1.概念的引入 相 ...