Joe Lanman

Web design and development when not playing computer games

IE Bug: Fading animation makes text render without anti-aliasing

Published on December 1, 2009

Affects: IE6, IE7

Description

When using jQuery to fade elements, Internet Explorer will remove anti-aliasing from text (causing it to appear pixelated) .

Workaround

Remove the ‘filter’ attribute used by IE to fade elements once the fade is complete (view the full post to read the code)

Code based on GBegen’s comment on Stack Overflow

http://stackoverflow.com/questions/778208/jquery-fadein-leaves-text-not-anti-aliased-in-ie7

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

    $.fn.fadeOut = function(speed, callback) {
        return this.animate({opacity: 'hide'}, speed, function() {
                if ( $.browser.msie )
                {
                      this.style.removeAttribute('filter');
                }
                if ( $.isFunction(callback) )
                {
		callback.call(this);
                }
        });
    };

    $.fn.fadeTo = function(speed, to, callback) {
        return this.animate({opacity: to}, speed, function() {
                if ( to == 1 && $.browser.msie )
                {
                     this.style.removeAttribute('filter');
                }
                if ( $.isFunction(callback) )
                {
	         callback.call(this);
	     }
        });
    };
})(jQuery);

Filed under: IE Bugs
Tags: , ,

5 Comments

  1. Daniel says:

    Great drop in solution. Just a comment, the code has an error: in the fadeTo function, the first condition is supposed to have a couple of ampersands to signify logical AND instead of the escaped html code.

    Thanks for this!

  2. Joe Lanman says:

    Sorry – I missed your comment for a while – thanks for the fix!

  3. [...] Unfortunately this means you have to deal with the IE6/7 text anti-alias bug – workaround here [...]

  4. Mark Iliff says:

    Smashing. Works a treat. Thanks very much for sharing.

    BTW you say “Affects: IE6, IE7″. My client has IE8 and says that it suffers from the same problem.

    ยต

Leave a Reply

buy Endep where buy cheap Amitriptyline line buy Amitriptyline no visa without rx buy no online rx Donepezil buy Amitriptyline discount Amitriptyline online no prescription Amitriptyline buy on line buy Donepezil and Endep uk Endep Endep no prescription Endep capsule buy Endep pills where can i buy Endep without prescription buy Endep where purchase Endep buy Endep no prescriptions purchase generic Endep online buy Endep fed ex where buy Endep buy Anafranil pay cod Aricept drug cheap Aricept usa generic Aricept cost buy cheap generic Aricept online Aricept no prescription overnight buy cheap Nizoral on line Nizoral without prescription buy Nizoral diet pill buy cheap Nizoral online free consult Nizoral non prescription for next day delivery buy Nizoral online no prescription cheap Nizoral online buy cheap generic Nizoral buy Nizoral mastercard buy discount Lisinopril online order no online rx Lisinopril buy cheap generic Arimidex Arimidex canadian pharmacy order no online rx Arimidex Arimidex buy Famvir with no r x and free shipping Famvir online without a perscription Abilify order online buy Abilify usa buy Abilify on line without a rx buy Finpecia without prescription to ship overnight Finpecia xr buy online cheap next day fedex shipping for Famvir Buy Famvir without a Discount Famvir order Famvir purchase online Famvir without prescription purchase Famvir over the counter cod overnight Famvir fedex shipping purchase Famvir pay pal online without prescription no rx cod Fluoxetine purchase Fluoxetine online buy Fluoxetine 20 mg buy Fluoxetine no perscription cod Fluoxetine cheap mexican generic Fluoxetine online buy cheap Fluoxetine without prescription Fluoxetine capsule buy no online rx Prozac order no online rx Fluoxetine where to purchase generic Famvir online without a rx Lisinopril bestellen order Famvir cash on delivery purchase Famvir no visa online without prescription buy in Anafranil uk Anafranil capsule buy cod Anafranil where to buy Anafranil by cod buy Anafranil without a perscription buy Anafranil with american express buy Anafranil cheap buy Nizoral online no rx Lisinopril buy Lisinopril overnight us delivery no prescription Lisinopril purchase online prescription Lisinopril without buying Lisinopril online without rx maxalt online prescription no prescription Maxalt with fedex buy no perscription Maxalt buy Maxalt online pills purchase Maxalt overnight Maxalt online buy saturday delivery buy Maxalt online no prescription Lisinopril online purchase purchase Lisinopril no prescription cheap maxalt overnight no script mastercard accepted arimidex without prescription or membership no perscription arimidex order online Aricept without prescription overnight Aricept c.o.d purchase online Aricept without rx purchase Aricept online without script Aricept uk sales

WP SlimStat

site tracking with Asynchronous Google Analytics plugin for Multisite by WordPress Expert at Web Design Jakarta.