JavaScript
Article
By Sam Deering

jQuery PNG Fix for IE6 Background Images

By Sam Deering

jQuery code snippet to fix those transparent PNG’s in IE6! It works best for background images with set dimensions. Just add a “.pngfix” class to anything you want fixed or put in some other jQuery selector.

--ADVERTISEMENT--

$('.pngfix').each( function() {
   $(this).attr('writing-mode', 'tb-rl');
   $(this).css('background-image', 'none');
   $(this).css( 'filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="path/to/image.png",sizingMethod="scale")');
});
Recommended
Sponsors
Get the latest in JavaScript, once a week, for free.