jquery - 简单的 JQuery 动画();不能在 ie 8 中工作?

标签 jquery html css internet-explorer internet-explorer-8

我一直在研究这个 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/

相关文章:

javascript - 在 modal/div 中显示 ajax 响应 - 当响应为网页形式时

jquery - 在溢出 :hidden element (jquery) 中查找最后一个可见的 li 元素

javascript - 保持复选框被选中,刷新并提交后

javascript - 适用于 Canvas HTML5 的 Jquery 画笔大小 slider

JQuery UI DatePicker 使用 2 个日期字段尝试获取日期差异

html - 如何显示具有固定位置的内联列表?

Javascript 表单验证

javascript - 将返回 5000 行的 AJAX 调用拆分为多个 100 行的 AJAX 调用

javascript - 信息窗口谷歌地图中的 Ionic 2 单击事件

html - Firefox 中的额外表单填充,但 Safari 中没有