IE is losing ClearType

后端 未结 7 986
滥情空心
滥情空心 2020-12-05 19:27

I\'m experiencing something really strange!

I have a div that I\'m hiding with JS (jQuery). Like this:

$(\'#myDiv\').hide();

Then w

7条回答
  •  醉酒成梦
    2020-12-05 20:15

    I've managed to pull a somewhat 'generic' solution. removeAttribute doesn't work if opacity is between 0 and 1, so my two cents solution follows:

    Put this code just after the first line of jQuery animate method definition (jquery.x.x.x.js)

    animate: function( prop, speed, easing, callback ) {
    var optall = jQuery.speed(speed, easing, callback);
    
    /*
     * IE rendering anti-aliasing text fix.
     */
    // fix START
    var old_complete_callback = optall.complete;
    optall = jQuery.extend( optall, {complete: function(){
        if (jQuery.browser.msie) {
            var alpha = $(this).css('opacity');
            if(alpha == 1 || alpha == 0) {
                this.style.removeAttribute('filter');
            }
        }
        if (jQuery.isFunction(old_complete_callback)) {
            old_complete_callback.call(this);
        }
    }});
    // fix END
    
    ...
    

    Hope this will help...

提交回复
热议问题