javascript - jQuery, Animate opacity to 1 then remove the opacity property to make it better looking on IE - Stack Overflow

I tried the jQuery fadeIn animation in all browsers and it work good, but not that much on IE. the Alph

I tried the jQuery fadeIn animation in all browsers and it work good, but not that much on IE. the Alpha png images are so creepy after appending the CSS opacity, but i have an idea and i don't know how to implement it using jQuery.

The idea is to fadeIn the element and when the animation is finished it will automatically remove the opacity property in order to make the picture quality better.

How to do that?

Note: i'm using Animate and not FadeIn.

Thanks

I tried the jQuery fadeIn animation in all browsers and it work good, but not that much on IE. the Alpha png images are so creepy after appending the CSS opacity, but i have an idea and i don't know how to implement it using jQuery.

The idea is to fadeIn the element and when the animation is finished it will automatically remove the opacity property in order to make the picture quality better.

How to do that?

Note: i'm using Animate and not FadeIn.

Thanks

Share Improve this question asked Apr 8, 2010 at 22:47 EmilyEmily 9153 gold badges10 silver badges13 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

If you set the opacity with jQuery to begin with (as 0):

$(object).css("opacity", 0); 

then after you fade it in, you can just:

$(object).fadeIn("slow", function(){ 
    $(object).css("opacity", "");
});

as the above answer didn't work for me in IE <= 8

You can do this:

$(selector).animate({opacity: 1}, function() {
  $(this).get(0).style.removeAttribute('filter');
});

The filter IE uses is what causes ClearType to basically turn off. Remove that style attribute after the fade pletes like the code above to restore ClearType to working order. You can also find replacement fadeIn(), fadeOut() and fadeTo() methods that deal with this issue here: http://malsup./jquery/fadetest.html

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743647777a4484049.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信