【发布时间】:2011-02-10 08:22:05
【问题描述】:
我遇到了一个相当普遍的问题(或者似乎是这样,经过一些谷歌搜索之后......),IE 在使用 jQuery 为不透明度设置动画时会弄乱粗体文本和透明 png。
您可以在此处查看示例:http://dev.gentlecode.net/dotme/index-sample.html(显然只出现在 IE 中)
我看到一些博客文章说解决方法是删除过滤器属性,但我不确定如何将它应用到我正在使用的脚本中,因为我从教程中得到它并且仍在学习 jQuery.. .
脚本如下:
$('ul.nav').each(function() {
var $links = $(this).find('a'),
panelIds = $links.map(function() { return this.hash; }).get().join(","),
$panels = $(panelIds),
$panelWrapper = $panels.filter(':first').parent(),
delay = 500;
$panels.hide();
$links.click(function() {
var $link = $(this),
link = (this);
if ($link.is('.current')) {
return;
}
$links.removeClass('current');
$link.addClass('current');
$panels.animate({ opacity : 0 }, delay);
$panelWrapper.animate({
height: 0
}, delay, function() {
var height = $panels.hide().filter(link.hash).show().css('opacity', 1).outerHeight();
$panelWrapper.animate({
height: height
}, delay);
});
return false;
});
var showtab = window.location.hash ? '[hash=' + window.location.hash + ']' : ':first';
$links.filter(showtab).click();
});
如果有人能检查一下并告诉我如何解决不透明度问题,我将不胜感激。过滤器方法是否也能解决我在透明 png 中遇到的问题,比如粗体类型的像素化丑陋边框?
提前感谢所有帮助!
【问题讨论】:
标签: jquery internet-explorer jquery-animate opacity