DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
PNG-24 Alpha Support For IE
What so much webdesigners dream about!
Get alpha channel on web, that's possible with PNG-24 images and this trick.
BE CAREFUL: that seem to work only for 10 images per page.
# Display PNG-24 images with alpha channel on IE
# BE CAREFUL: with this trick, only 10 PNGs seems to be supported by IE
# Don't forget to set the size of your div
def transpng(id, png)
'<style type="text/css">
<!--
' + id + ' {
background-image: url(' + png + ');
}
-->
</style>
<!--[if IE]>
<style>
' + id + ' {
background-image: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + png + ', sizingMethod=\'scale\');
}
</style>
<![endif]-->'
end





Comments
Snippets Manager replied on Wed, 2006/07/19 - 2:16pm