Search

1/12/2009

Image Optimization, Part 5: AlphaImageLoader

Image Optimization, Part 5: AlphaImageLoader » Yahoo! User Interface Blog


#some-element {
background: url(image.png);
_background: none;
_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png', sizingMethod='crop');
}

The reason to target IE prior to version 7 is that IE7 supports the alpha transparency natively without the need for filters. (IE8 does too and it actually changes the filter syntax completely.)

It’s interesting to note that the filter doesn’t change the image; rather, it changes the HTML element this style is applied to. The other interesting thing is that each element is processed synchronously in a single UI thread. The process applying the filter takes some resources for each element and the more “filtered” elements you have, the worse it gets, even if you use the same image for all the elements.

DD_belatedPNG: Medicine for your IE6/PNG headache!
tag: alpha imageloader transparent vml

沒有留言: