开发者

Shadow/Filter not working in ie after animation like fadeIn

Guys Need your help. I have a shadow applied to Div thru CSS, but in ie shadow doesn't show with animation like .fadeIn or .show("slow") Initially Div hidden(display:none) I also tried to apply style right after animation, but with now luck.

$(document).ready(function() {
 var obj = $(开发者_如何学编程'#message')
    //obj.show(); //Working
    obj.fadeIn("slow"); //NOT Working
    obj.addClass("shadow")
});

Here is my code jsFiddle

Is anything can be done for ie or not?

Thanx a lot.


Found an answer in this Post

Just need to add this to my js or Plugin Code

jQuery.fn.fadeIn = function(speed, callback) { 
return this.animate({opacity: 'show'}, speed, function() { 
    if (jQuery.browser.msie)  
        this.style.removeAttribute('filter');  
    if (jQuery.isFunction(callback)) 
        callback();  
}); 

};

Thank you Nick Lowman


I believe this is because jquery removes filter attributes while animating opacity because IE cannot render them properly. You could add the filter attribute back in after the animation completes.

http://jsfiddle.net/u7CJv/10/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜