Unit PNG Fix & IE PNG Fix - 解决IE6下PNG透明问题

IE6下的PNG图片的透明是个老问题了,前几天也为此而烦恼,不过现在搜到个十分简单的解决方法,只需要一个的JS文件和一个1*1象素的GIF图片即可。

Unit PNG Fix

Waaaaah! Waaaaaah! You hear that? That’s IE6 whining about how you should be using an obtuse “filter” attribute, causing all those nice, pretty pngs on your page to go whacky. Fortunately for you, we got just the thing to shut it up. Give it just the tiniest dose of our Unit PNG Fix and bask in the the glorious phosphoresence of your png images once again! While this is not the only png fix out there (in fact, it was inspired by Drew McLellan’s supersleight), here’s why it will be the last one you need to download:

  • Very compact javascript: Under 1kb!
  • Fixes some interactivity problems caused by IE’s filter attribute.
  • Works on img objects and background-image attributes.
  • Runs automatically. You don’t have to define classes or call functions.
  • Allows for auto width and auto height elements.
  • Super simple to deploy.

Demo | 下载地址:http://labs.unitinteractive.com/downloads/unitpngfix.zip


IE PNG Fix也是一个类似的解决方案:

This script adds near-native PNG support with alpha opacity to IE 5.5 and 6. Now you can have full translucency and no more ugly grey borders! It requires only one line in your CSS file, and no changes to your website HTML. <IMG> tags and background images are both supported.

Demo | 下载地址:http://www.twinhelix.com/css/iepngfix/iepngfix.zip

11 条评论

发表评论

*