jQuery IE Cleartype glitch on fadeout!

2019-09-08 17:09发布

问题:

Please do not point me to more articles about this issue I think I've read them all... I have a div that has some text in it and I just wanted to fade it out in jQuery:

$(document).ready(function(){
  $('#dHeaderMessage').fadeOut(12000, function() { 
    });  
});

This fades out correctly but the text inside of this div looks awful when the page first loads up (IE8). So I googled it and it mentioned its some ClearType font issue with IE. The workaround was to remove a "filter" in javascript like so:

document.getElementById('dHeaderMessage').style.removeAttribute("filter");

But this did not seem to make any change...so I tried doing it right within the jQuery:

$('#dHeaderMain').fadeOut(12000, function() { 
        this.style.removeAttribute("filter");
    }); 

Still the same issue the text looks blurry... How can I solve this?

回答1:

Here is what you can do:

$('#dHeaderMessage').delay(20000).fadeOut('slow');



回答2:

I had this problem, I found it easy to fix. If you can, give the div a background color. That fixed it for me.