There are numerous scripts available, but typically a JavaScript solution isn't the best way to do this.
You'll get a brief flicker of grey while the page loads, it adds processing to the critical domready event and it only works for people with JavaScript enabled.
A better solution is to use the 'htc fix' that enables near-native PNG support to old versions of IE via IE's proprietary 'behaviours' CSS extension.
http://www.twinhelix.com/css/iepngfix/You can add:
- behavior: url("iepngfix.htc");
to any elements you need the behaviour applied to, ideally within a conditional comment targeted at IE6 and under.
For example:
- <!--[if lte IE 6]>
- <style type='text/css'>
- img, div { behavior: url("iepngfix.htc") }
- </style>
- <![endif]-->
-
(Obviously ensuring that the url points at the .htc file correctly)
Good luck