jQuery 不透明度和 fadeTo();在IE8中
这一点不起作用:
$(this).stop().fadeTo('slow', 0.4, function() {
$(this).addClass('hidden')
});
所以我测试了这个:
$(this).css('opacity',0.3);
在 IE8 中没有成功:/(IE7 + Chrom + FF + Safari 一切正常 - 调试 js 一切正常...)
所以我继续在谷歌上搜索问题并尝试了这个
$.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();
});
};
: (CSS...):
display:inline-block;
在 IE8 中仍然没有成功...有什么帮助吗???
更新: 这接缝有效:
$(this).children('img').stop().fadeTo('slow', 0, function() {});
所以它是图像更新的问题
: DOM 元素 -> $(this) 指的是
<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>
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 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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您说“这个位不起作用”,但没有说明您想要实现什么,也没有说明该代码的结果是什么或
this
指的是什么。看看我在另一个问题中提出的 http://jsfiddle.net/YhzPh/ ,看看是否这有帮助。
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.