Opacity doesn't work on images which were dynamically loaded in IE6

The following code adjusts the opacity of an image which were dynamically loaded. It works on all browsers except for IE6.

However, jQuery did apply inline styles “FILTER: alpha(opacity=30); ZOOM: 1” on the image. It just doesn’t work.

Is there a workaround?

(Attached zip is the HTML page of the following code)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
    <script type="text/javascript">

        $(document).ready(function() {

            $('<img />')
            .attr({ src: "http://www.sitepoint.com/wp-content/themes/thesis/custom/images/logo.png" })
            .css({ opacity: 0.3 })
            .appendTo('body')

        });

    </script>
</head>
<body>
</body>
</html>

It might be possible on IE6 with workarounds such as: http://docs.jquery.com/Tutorials:PNG_Opacity_Fix_for_IE6

Keep in mind though that IE6 is now over 10 years old, and it officially died last year, with a funeral and everything. http://ie6funeral.com/
Attempts to keep IE6 alive now border on the necrophiliac.

Thanks. The image being loaded is not always PNG. It can be JPG, so PNG-fix is not enough. And I did try IE filter alpha image load, it doesn’t work.

With regard to the IE6 market share, I know the stats are fine in North America, Europe, and Oceania. However, I sometimes have to code for Chinese websites. The stats of IE6 are okay in Taiwan and [URL=“http://gs.statcounter.com/#browser_version-HK-daily-20111101-20111120-bar”]Hong Kong, but it’s unacceptable in [URL=“http://gs.statcounter.com/#browser_version-CN-daily-20111101-20111120-bar”]China. Therefore abandoning IE6 is not a good idea for Chinese websites currently.