How to maintain PNG alpha transparency when using “-ms-filter” property

后端 未结 3 615
挽巷
挽巷 2020-12-29 00:26

I have the following HTML:

 Some text

And this css:

a:hover
{
    -ms-fi         


        
3条回答
  •  北海茫月
    2020-12-29 00:49

    Just embellishing SpliFF's answer, I could fix this problem by adding the following jQuery to my page:

    $(function() {
        if (jQuery.browser.msie)
            $('img[src$=".png"]').each(function() { // must have quotes around .png
                this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+this.src+",sizingMethod='scale')";
            });
    });
    

    This will apply the AlphaImageLoader too all PNGs in the page.

提交回复
热议问题