A patch for jQuery that fixes jaggie text in IE when using opacity.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


When animating or setting opacity in IE 6, 7 and 8, text loses it's ClearType antialiasing. This is due to Microsoft's implementation of their filters, which are used to achieve opacity manipulation. The way to restore the ClearType antialiasing on text is to simply remove the filter attribute from the elements style: elem.style.removeAttribute('filter). This monkey patch hijacks the animate and css methods, inserting a test to check the value of the element's opacity after said function has completed executing. If the element's opacity value is 1 or 0, the filter attribute is automatically removed, restoring the ClearType antialiasing in IE. Also, due to the fact that the animate method is used to implement the fadeIn, fadeOut and fadeTo methods, the ClearType issue is fixed in these methods as well.

This bug has been outstanding in jQuery for years and has had countless tickets created for it. As far as I can tell, it's being blocked by the fact that Microsoft supports a handful of ridiculous filters -- http://msdn.microsoft.com/en-us/library/ms532853(v=VS.85).aspx -- and if you remove the filter attribute from an element, you could be removing other filters along with opacity. In my opinion, if you're using filters other than alpha(opacity=N) or maybe AlphaImageLoader, you're doing it wrong. Relevant links: