Transparent PNG animate problem on Internet Explorer

前端 未结 10 2071
误落风尘
误落风尘 2020-12-29 16:05

CSS Code:

#btn{
  background: url(transparent.png) no-repeat;
  filter: alpha(opacity=0);
  -moz-opacity: 0;
  -khtml-opacity: 0;
  opacity: 0;
}


        
相关标签:
10条回答
  • 2020-12-29 16:53

    Use PNG image for modern Browsers ( mozilla , Opera, Chrome etc ) :

    background:url(../images/banner01.png) no-repeat right 13px;
    

    Add this For IE ( Use another CSS Or use IE hack )

    /* ie fix */
    background-image:none;
    filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="images/banner01.png",
     sizingMethod="crop");
    
    0 讨论(0)
  • 2020-12-29 16:58

    filter:'' hack does not work with current jQuery (1.6.1) anymore

    0 讨论(0)
  • 2020-12-29 16:59

    There is currently no solution for this that I'm aware of. Just have to wait for IE to catch up with the rest of the world. I had to abandon such a feature in a recent project just days ago. You unfortunately cannot have a feathered-edge PNG with IE fading in and out with jQuery.

    0 讨论(0)
  • 2020-12-29 17:06

    For me it worked to just include the filter property with blank value in jQuery's .animate()function

    Maybe this will work for you, too.

    $("#btn").animate({opacity:1,"margin-left":"-25px", filter:''});

    Additionally you might have to remove the filter property from your button's CSS.

    0 讨论(0)
提交回复
热议问题