Global Replacement for fadeIn - IE Error, jQuery?

You could override the show() method so that it does the fadeIn() if it's a compatible browser, or revert to the original show() if it is not. Here's an example: button id="go">Try Me Your Content (function($, oldMethod) { $.fn. Show = function() { if ($.browser.

Msie && $.browser.version. Substr(0,1) Css("opacity",0); oldMethod. Apply(this, arguments); $.fn.animate.

Apply($(this0), {opacity:1}, {duration:1000}); } }; })(jQuery, jQuery.fn. Show); $(function() { $('#go'). Click(function() { $('#test').show(); }); }); Msie && $.browser.version.

Substr(0,1) Css("opacity",0); oldMethod. Apply(this, arguments); $.fn.animate. Apply($(this0), {opacity:1}, {duration:1000}); }; } })(jQuery, jQuery.fn.

Show) This is such that the function is only overridden for non-IE browsers under version 9 A jsFiddle example The original show() function can simply still exist Also, the reason for this chunk: $(this0). Css("opacity",0); oldMethod. Apply(this, arguments); $.fn.animate.

Apply($(this0), {opacity:1}, {duration:1000}) Is because fadeIn() calls show() at some point, and we end up with a stack overflow because of the infinite recursion. Calls to animate({opacity:"show"}) also call show()`, so that didn't work either. I dug through the jQuery code to pull out the important bits to recreate the effect without causing a stack overflow.

You could override the show() method so that it does the fadeIn() if it's a compatible browser, or revert to the original show() if it is not. Here's an example: Try Me Your Content You can see a demo with this jsFiddle. I tested in IE9 and Chrome 13 and seemed to work well.

EDIT I just realized that this is sort of inefficient. It's checking the browser version on every call to show(). You might be able to do this instead (untested): (function($, oldMethod) { if (!($.browser.

Msie && $.browser.version. Substr(0,1) Css("opacity",0); oldMethod. Apply(this, arguments); $.fn.animate.

Apply($(this0), {opacity:1}, {duration:1000}); }; } })(jQuery, jQuery.fn. Show); This is such that the function is only overridden for non-IE browsers under version 9. A jsFiddle example.

The original show() function can simply still exist. Also, the reason for this chunk: $(this0). Css("opacity",0); oldMethod.

Apply(this, arguments); $.fn.animate. Apply($(this0), {opacity:1}, {duration:1000}); Is because fadeIn() calls show() at some point, and we end up with a stack overflow because of the infinite recursion. Calls to .

Animate({opacity:"show"}) also callshow()`, so that didn't work either. I dug through the jQuery code to pull out the important bits to recreate the effect without causing a stack overflow.

Oh, that's interesting...how would I do that with if ($.browser. Msie && $.browser.version. Substr(0,1)– Yahreen Aug 10 at 18:26.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions