Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6326797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:09:32+00:00 2026-05-24T17:09:32+00:00

Is there a way to do a global replacement for the fadeIn effect in

  • 0

Is there a way to do a global replacement for the fadeIn effect in jQuery to side-step the issue where fading in a transparent png in IE6-IE8 shows a distrortion?

What I mean is, I have something like this at the moment:

$(whichCarousel).find('ul.display li:eq(' + aSpecimen + ')').fadeIn("fast");

Rather than going through each function of mine that uses .fadeIn and doing if/else statements, is there a way in jQuery to globally say:

if ($.browser.msie && $.browser.version.substr(0,1)<9) >> find ".fadeIn" and change to ".show();"` ?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:09:32+00:00Added an answer on May 24, 2026 at 5:09 pm

    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</button>
    <div id="test" style="display: none">Your Content</div>
    
    <script type="text/javascript">
    
    (function($, oldMethod) {    
        $.fn.show = function() {
            if ($.browser.msie && $.browser.version.substr(0,1) < 9) {
                oldMethod.apply(this, arguments);   
            } else {
                $(this[0]).css("opacity",0);
                oldMethod.apply(this, arguments);
                $.fn.animate.apply($(this[0]), [{opacity:1}, {duration:1000}]);
            }
        };
    })(jQuery, jQuery.fn.show);
    
    $(function() {
        $('#go').click(function() {
            $('#test').show();
        });
    });
    
    </script>
    

    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) < 9)) {
            $.fn.show = function() {
                $(this[0]).css("opacity",0);
                oldMethod.apply(this, arguments);
                $.fn.animate.apply($(this[0]), [{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:

    $(this[0]).css("opacity",0);
    oldMethod.apply(this, arguments);
    $.fn.animate.apply($(this[0]), [{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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to declare a global variable in jQuery in its own
Is there a way to set the global windows path environment variable programmatically (C++)?
Is there a way to register for global mouse moved events in Cocoa? I
Is there a way to have different Global Configurations for each section of articles?
Is there any way or a library to get a system-wide (global) keyboard shortcut
Is there any way i can access the page object from within the global.asax
Is there a way to handle the application_start event without using the global.asax? The
In python, there is no way to differentiate between arguments, local variables, and global
I'm using C# and Caliburn. Is there a global way to catch all exceptions
Is there a way to setup a global list of Ignores for a SVN

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.