views:

230

answers:

3

Hey guys

I was playing around with this script of auto scrolling text. You can check out the code here:

http://jqueryfordesigners.com/simple-jquery-spy-effect/

Then I changed the background color to white - and all the text started looking fuzzy and messed up - If I change it to any light color - it appears all messy.

This is the portion where I changed the background color in the code:

#sidebar {
    color: grey;
    background: #FFF;
    float:left;
    margin:0 0 24px;
    padding:15px 10px 10px;
    width:500px;
}

I have noticed this in one other site even on IE7. Any idea why a simple change in background color messes up the text.

I used IE tested to test on IE6 browser http://www.my-debugbar.com/wiki/IETester/HomePage

Thanks

+1  A: 

because ie6 sucks!

aleo
+3  A: 

Are you certain you're not using IE css filters in an element further up the tree, such as alpha transparency? They can make text blurry/fuzzy when ClearType (font smoothing on LCD monitors) is enabled, especially for bolded text, so much so that cleartype was disabled for elements which use CSS filters in IE7+.

See also http://blogs.msdn.com/ie/archive/2006/08/31/730887.aspx

EDIT: Here's an example of what you could do to remove the filter after the items have first faded in:

// increase the height of the NEW first item
$insert.animate({ height : height }, 1000).animate({ opacity : 1 }, 1000);

might go to

// increase the height of the NEW first item
$insert.animate({ height : height }, 1000).animate({ opacity : 1 }, 1000,
    function() {
        if ($.browser.msie) {
            $(this).get(0).style.removeAttribute('filter');
        }
    });

See also http://stackoverflow.com/questions/2603961/jquery-animate-opacity-to-1-then-remove-the-opacity-property-to-make-it-better-l

David Morrissey
Thanks David, I've not added anything to that piece of code except change the background color to white.
Gublooo
debugging the rolling elements in the IE dev toolbar, they have a `filter: alpha(opacity=100);` after they've finished fading, so that looks like the problem - you may be able to delete the "`filter`" CSS property to turn off the DirectX/ClearType blurriness once the "fade in" animation has finished :-P
David Morrissey
David - are you referring to this line in the javascript code $list.find('> li').filter(':gt(' + (limit - 1) + ')').remove();
Gublooo
no, the `.filter` in that line has nothing to do with the CSS `filter`, it's for searching through elements which meet the conditions of a selector in JQuery (http://api.jquery.com/filter/), see my edited answer for an example of how to remove CSS filters
David Morrissey
hey david - thanks - that almost did the trick in IE6 - the text appears fuzzy but a second later becomes clear - but after making that change - the scrolling has stopped working in firefox and chrome - the first element appears and then the list stops scrolling
Gublooo
@Gubloo: sorry, that line only worked in IE - I've edited the answer to fix that. There probably isn't any way of fixing the blurriness in IE6 except by disabling fading in/out by removing the `.animate({ opacity...)` parts though
David Morrissey
That will work for me - thank you so much for taking the time to help me - appreciate it.
Gublooo
+1 David, for the fast edit ;)
CuSS
+2  A: 

I will finish the David M Question. You have to remove the IE CSS Filter property.

I see that you are using jQuery.

If you are using fadeIn, fadeOut and fadeTo functions, add this to your code:

(function($) {
$.fn.FadeIn = function(speed, callback) {
$(this).fadeIn(speed, function() {
if(!$.support.opacity)
$(this).get(0).style.removeAttribute('filter');
if(callback != undefined)
callback();
});
};
$.fn.FadeOut = function(speed, callback) {
$(this).fadeOut(speed, function() {
if(!$.support.opacity)
$(this).get(0).style.removeAttribute('filter');
if(callback != undefined)
callback();
});
};
$.fn.FadeTo = function(speed,to,callback) {
return this.animate({opacity: to}, speed, function() {
if (to == 1 && jQuery.browser.msie())
this.style.removeAttribute('filter');
if (jQuery.isFunction(callback))
callback();
});
};
})(jQuery); 

And replace (fadeIn, fadeOut, fadeTo) to (FadeIn, FadeOut, FadeTo). (the difference is on the F)

Otherwise use:

$(selector).removeAttribute('filter');

If you need some more info comment my answer and i will edit it :) I think this is what you want. Sorry for my english. :(

CuSS
Thanks CuSS - I checked out the Javascript code and it uses no fadeIn,fadeOut or fadeTo functions. You can check the code in this link http://jqueryfordesigners.com/simple-jquery-spy-effect/ - I have not changed anything in this code except the background color
Gublooo