Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 377
Emily Avatar asked Dec 22 '22 04:12

Emily


1 Answers

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

like image 165
Joshua Smickus Avatar answered Mar 15 '23 23:03

Joshua Smickus