jQuery pngIE

PngIE, a jQuery plugin, unobtrusively resolves transparent png’s in your web page when viewed in Internet Explorer 6. Like many other scripts for fixing PNG transparency in IE6, PngIE uses Microsoft’s  AlphaImageLoader filter. Unlike many other solutions, PngIE  :

  • Does not require you to follow a naming convention.
  • Does not distort your images.
  • Does NOT change your DOM hierarchy.
  • Does not invoke additional http requests or strain your readers’ CPU.
  • Does fix dynamically loaded images.
  • Does fix background images.

Source: http://github.com/davebelais/jquery-pngie/raw/master/jquery.pngie.js

Minified: http://github.com/davebelais/jquery-pngie/raw/master/jquery.pngie.min.js

Usage

To initialize:

$(document).pngie();

Optionally, you can pass an options object.

$(document).pngie({
blankgif:'http://upload.wikimedia.org/wikipedia/commons/c/ce/Transparent.gif',
sizingMethod:'crop'
 });

The defaults are shown above. PngIE needs a blank gif image to operate, by default blankgif is pulled off of wikimedia. sizingMethod can be ‘crop’, ‘image’, or ‘scale’. It is recommended this be left on the default: ‘crop’.  See Microsoft’s documentation on AlphaImageLoader for more information.

Limitations

PngIE passes over background images which repeat or are positioned, as AlphaImageLoader cannot render these properly. In keeping with the objective of keeping pngIE unobtrusive, fast, and reliable, no hacks are used to simulate tiling or positioning. It may be noted, however, that because of the way PNG images are compressed, you can manually tile or position the elements in your photo editor with only a fractional ( < 5% ) penalty in download size.


» Issue Tracking