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

推荐订阅源

The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
Engineering at Meta
Engineering at Meta
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
I
InfoQ
S
SegmentFault 最新的问题
博客园 - 叶小钗
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
IT之家
IT之家
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
月光博客
月光博客
The Cloudflare Blog
U
Unit 42
GbyAI
GbyAI
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - 布瓜去旅行

适时放手,是对自己的尊重 PhoneGap初试! 【转】Swift之 ? 和 ! 一场空欢喜 不要悲伤,我亲爱的好姑娘 更新证书错误:No matching provisioning profiles found CABasicAnimation的基本使用方法(移动·旋转·放大·缩小) ASP.NET中解决跨子域的Session共享 iPhone4S出现应用无法打开时的解决方案 [转] XCode 4.2 新功能 - Storyboard [摘] Objective-C的self.用法的一些总结 C# winform 与 flash as 的交互通讯 【转】DD_belatedPNG,解决IE6不支持PNG绝佳方案 IE6中margin值双倍的解决方案 [转] 弹性+固宽布局 Windows2003下配置PHP环境 去除Visual Studio .NET工程同SourceSafe的关联 遭遇价格欺诈 塑料瓶底的标志的含义!
IE6中正确显示png图片
布瓜去旅行 · 2011-08-22 · via 博客园 - 布瓜去旅行

在ie6中,png图片总是显示一个灰背景,很丑,从网上查了下解决办法如下,原文已经打不开了,所以就不注原文地址了,需要准备一个文件名为blank.gif的透明图片:

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 && version < 7.0&& (document.body.filters)) 
    { 
       
for(var j=0; j<document.images.length; j++
       { 
          
var img = document.images[j]; 
          
var imgName = img.src.toUpperCase(); 
          
if (imgName.substring(imgName.length-3, imgName.length) == "PNG"
          { 
            
var width = img.width; 
   
var height = img.height; 
   
var sizingMethod = (img.className.toLowerCase().indexOf("scale">= 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;
          } 
       } 
    }     

window.attachEvent(
"onload", correctPNG);