jquery.pngFix.js
PNG-Transparency for Windows IE 5.5 & 6

This plugin will fix the missing PNG-Transparency in Windows Internet Explorer 5.5 & 6.

Features

  • unobtrusive script, simple to setup
  • works now also with CSS-Backgrounds (but scaling backgrounds)
  • works with PNG-Images within Links
  • TITLE, ALT, CLASS and STYLE-Attributes are considered

This page uses jQuery Version

E x a m p l e s:

PNG with transparency

<img src="pngtest.png" width="173" height="173" alt="This is the alt-Text" />
This is the alt-Text

PNG with TITLE-Attribute

<img src="pngtest.png" width="173" height="173"
	title="This is the title-Text" alt="This is the alt-Text" />
This is the alt-Text

PNG within a link

<a href="#" onclick="alert('click');return false;">
	<img src="pngtest.png" width="173" height="173"
		title="This is the title-Text" alt="This is the alt-Text" />
</a>
This is the alt-Text

PNG within a link and a STYLE-Attribute

<a href="#" onclick="alert('click');return false;">
	<img src="pngtest.png" width="173" height="173"
		style="border:1.0em dashed #090;padding:10px;margin:10px;"
		title="This is the title-Text" alt="This is the alt-Text" />
</a>
This is the alt-Text

Div with PNG-Background via CSS

<div>
<div style="float:left;width:173px;height:173px;
background: url(pngtest.png);">
This is a div-Container using a png as background ...
</div>
<div style="float:right;width:346px;height:346px;
background: white url(pngtest.png);">
This is a div-Container using a png as background ...
</div>
<div style="clear:both;"></div>
</div>
This is a div-Container using a png as background ...
This is a div-Container using a png as background ...


Input with PNG-Source

<form>
<input type="image" src="pngtest.png" width="173" height="173" />
</form>

How to use jquery.pngFix.js

1.
Download jQuery
Download pngFix.zip View Source

2.
Add jQuery and pngFix to the HEAD-Section of your HTML ...

<head>
...
<script type="text/javascript" src="jquery-latest.pack.js"></script>
<script type="text/javascript" src="jquery.pngFix.js"></script>
...
</head>

3.
Activate pngFix on document.ready

<head>
...
<script type="text/javascript">
	$(document).ready(function(){
		$(document).pngFix();
	});
</script>
...
</head>

Test PNG (without transparency in IE 5.5 & 6)
PNG without transparency This is the alt-Text
Switch above PNG to transparency

下载代码说明
X关闭

基于jquery的兼容IE5.5及IE6浏览器的PNG透明插件

基于jQuery为核心的,兼容IE5.5及以上版本浏览器的PNG透明插件,细心的朋友会发现,在IE5.5与IE6.0中,PNG会显示灰色的背景,而不是透明的背景,有些人误认为是PNG图像的问题,在图像软件中任凭怎么调整都解决不了问题,其实问题出在浏览器身上,IE7及以上版本已解决了PNG透明问题,但现在仍有不少用户在使用IE6及以下版本,因此如果想让你的PNG图像在多种浏览器下都表现良好,本插件