惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MongoDB | Blog
MongoDB | Blog
罗磊的独立博客
美团技术团队
B
Blog
量子位
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
aimingoo的专栏
aimingoo的专栏
The GitHub Blog
The GitHub Blog
博客园 - 聂微东
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
DataBreaches.Net
博客园 - 三生石上(FineUI控件)
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Vercel News
Vercel News
Blog — PlanetScale
Blog — PlanetScale
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
S
SegmentFault 最新的问题

博客园 - 袁礼定

推荐网站: guship.cn 推荐网站: 开发测试教程 devqa.cn C#参考教程 http://www.csref.cn 最全的运营推广方案,教你如何从零开始运营APP SEO: Response.Redirect() 摘抄: Windows XP登录口令丢失的应急办法 随想 .net中统计时间的方法 zhaichao: 蔡文胜:站长之王 Sub String in Dos command Merge file using dos command Trip to America for 3 more months 明天的飞机,到美国培训和出差三个月,记一笔 javascript 游戏开发 乡村与城市的差别不是18年! 本人从事软件技术开发也有多年,打算先尝试往外迈一步试试! 在办公室里面不能访问部分.cn域名的网站,但不在办公室里面就能访问 汉字转拼音缩写的函数(C#) Get Sender Email Address from Outlook using CDO in C#
摘抄:透明PNG在IE6下的官方解决方案
袁礼定 · 2008-04-04 · via 博客园 - 袁礼定

摘自: http://www.cbmland.com/post/376/transparent-png-in-ie6-utility.html

做Web开发的朋友一定都知道PNG是一个相当不错的图片格式,但是这个好的格式却在IE6时代造成了麻烦,IE6会使透明的PNG的透明部分出现#DBEAED的色彩。透明不了。使得在FF下开发表现很好的界面换成IE浏览就惨不忍睹,又逼着换成GIF,而GIF的假透明在变换背景时造成毛边现象。

 刚去了www.gowindowslive.com去生成一个WLM的联系方式图标,结果发现的官方的解决方案。;)

核心函数贴出来供分析

 
/*
Correctly handle PNG transparency in Win IE 5.5 & 6.
Copyright 2007 Ignia, LLC
Based in part on code from from http://homepage.ntlworld.com/bobosola.
 
Use in  with DEFER keyword wrapped in conditional comments:
 
<script type="text/javascript" defer="true" src="pngfix.js"></script>
 
*/

 
function fixPng() {
  var arVersion = navigator.appVersion.split("MSIE")
  var version = parseFloat(arVersion[1])
 
  if ((version &gt;= 5.5 &amp;&amp; version &lt; 7.0) &amp;&amp; (document.body.filters)) {
    for(var i=0; i<document.images.length;></document.images.length;>      var img = document.images[i];
      var imgName = img.src.toUpperCase();
      if (imgName.indexOf(".PNG") &gt; 0) {
        var width = img.width;
        var height = img.height;
        var sizingMethod = (img.className.toLowerCase().indexOf("scale") &gt;= 0)? "scale" : "image";
        img.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src.replace('%23', '%2523').replace("'", "%27") + "', sizingMethod='" + sizingMethod + "')";
        img.src="images/blank.gif" mce_src="images/blank.gif";
        img.width = width;
        img.height = height;
        }
      }
    }
  }