我遇到了一个相当常见的问题(或者看起来是这样,经过一番谷歌搜索后...),IE 在使用 jQuery 动画不透明度时会弄乱粗体文本和透明 png。
您可以在此处查看示例:http://dev.gentlecode.net/dotme/index-sample.html 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 中遇到的问题,这些透明 png 也有像素化的丑陋边框(如粗体类型)?
预先感谢所有帮助!