我一直在研究这个 jquery 片段,它在 chrome 和 firefox(即 10 和 ie 9)中运行良好,但 ie 8 将无法运行。我哪里错了,写的jquery好像是对的。我可以做些什么来增强此代码并使其在 ie 8 上运行。检查 chrome 或 firefox 右上角的搜索栏(它具有工作功能)。然后在ie 8中检查它。好像代码正在终止或没有完成功能?访问 harley.bushcommunications.com。
/* SEARCH DROP DOWN */
$('#header .search').mouseenter( function() {
$('.search').css({'z-index': '2', 'filter': 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#d8ffffff, endColorstr=#d8ffffff)', '-ms-filter': '"progid:DXImageTransform.Microsoft.gradient(startColorstr=#d8ffffff, endColorstr=#d8ffffff)"'});
$('#header .search').animate({width: '15%'});
$('#header .search > ul').show();
$('#header input.input-hide, .search-submit').css({'display': 'block'});
$('.cal').css({'z-index': '1'});
$('.cal .right-text').fadeOut();
});
$('#header .search').mouseleave(function() {
$('#header > .serach > ul > p').css({'opacity': '0.0'}, 0);
$('.cal').css({'z-index': '2'});
$('.search').css({'z-index': '1'});
$('#header .search > ul').hide(0);
$('#header .search').animate({width: "125"}, 250);
$('input.input-hide, .search-submit').hide();
$('.cal .right-text').fadeIn();
});
/* CALENDAR DROP DOWN */
$('#header .cal').hover(function() {
$(this).animate({width: '15%'}, 250, 'linear');
$(this).find('ul').animate({'height': '200'},1000, 'easeOutBounce');
$('.calendar').show();
},
function() {
$('#header .cal').animate({width: '125'}, 500);
$('#header .cal > ul').animate({height: '0'}, 250, 'linear');
$('.calendar').hide();
});
最佳答案
IE8 不支持不透明度
。它改为使用 filter:alpha(opacity=X)
,其中 X 是 0 到 100 之间的一个值。
关于jquery - 简单的 JQuery 动画();不能在 ie 8 中工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17225513/