A quick search on the subject shows the following:
jQuery fadeIn/fadeOut IE cleartype glitch
The problem seems to be that the CSS "filter" attribute is not automatically removed. The most simple solution to this problem would be removing it manually:
$('#myDiv').fadeIn('slow', function() {
this.style.removeAttribute('filter');
});
As the blog post above explains, this is a rather messy solution.
Excerpt from the blog post, including a cleaner solution to this problem:
This means that every single time we
want to fade an element, we need to
remove the filter attribute, which
makes our code look messy.
A simple, more elegant solution would
be to wrap the .fadeIn() and
.fadeOut() functions with a custom
function via the plugin interface of
jQuery. The code would be exactly the
same, but instead of directly calling
the fade functions, we call the
wrapper. Like so:
$('#node').customFadeOut('slow', function() {
//no more fiddling with attributes here
});
So, how do you get this working? Just
include the following code after you
include the jQuery library for the
added functionality.
(function($) {
$.fn.customFadeIn = function(speed, callback) {
$(this).fadeIn(speed, function() {
if(jQuery.browser.msie)
$(this).get(0).style.removeAttribute('filter');
if(callback != undefined)
callback();
});
};
$.fn.customFadeOut = function(speed, callback) {
$(this).fadeOut(speed, function() {
if(jQuery.browser.msie)
$(this).get(0).style.removeAttribute('filter');
if(callback != undefined)
callback();
});
};
})(jQuery);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…