开发者

jQuery opacity and fadeTo(); in IE8

this bit dont work:

$(this).stop().fadeTo('slow', 0.4, function() {
                    $(this).addClass('hidden')
                });

so i tested this:

$(this).css('opacity',0.3);

no success in IE8 :/ (IE7 + Chrom + FF + Safari everything ok - debbuging js everthing ok... )

so i went on google and searched the problem and tried this:

 $.fn.customFadeTo = 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();
    });
};

and this (CSS...):

display:inline-block;

still no no success in IE8... any help???

UPDATE: this seams 开发者_Python百科to work:

$(this).children('img').stop().fadeTo('slow', 0, function() {});

so its a problem with the images

UPDATE: the DOM element -> $(this) refers to

<a class="alle-referenzen referenzenDetailLink" href="webdesign-referenzen-hotel-chesa-randolina" title="Hotel Chesa Randolina"> 
                <span> 
                    <b>Hotel Chesa Randolina</b><br /> 
                    Webdesign, Blog, CMS, Programmierung, Suchmaschinenoptimierung
                </span> 
                <img src="/images/content/Referenzen/HotelRandolina/Website_Hotel-Randolina.jpg" alt="Hotel Chesa Randolina" /> 
                <img class="out" src="/images/content/Referenzen/HotelRandolina/Logo_Hotel-Randolina.jpg" alt="Hotel Chesa Randolina" />            
            </a> 


First off, you says "this bit won't work" but have given no indication of what you want to achieve nor what the result of that code was or what this refers to.

Have a look at http://jsfiddle.net/YhzPh/ which I made in relation another question to see if that helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜