javascript - jQuery 导航在 IE7 中不工作

标签 javascript jquery css internet-explorer internet-explorer-7

我在主导航元素中有以下代码。它本质上是一个 css-sprite,一旦用户将鼠标悬停在菜单上,它就会被覆盖。这在除 IE7 之外的所有浏览器中都能完美运行(ie6 未测试)。我试过调试我的 css,感觉这是专门来自 jQuery/JS 代码的。是否有一些我可能正在使用的 jQ 代码导致了错误?感谢您提供任何帮助。

问题是一旦悬停,跨度就不会在 IE7 中显示。所有其他浏览器都可以正常工作。

  jQuery('#menu-main-navigation').find('li > a')
         .append('<span class="hover"></span>')
         .hover(function() {
              jQuery('.hover', this)
                .stop()
                .animate({
            opacity: 1
                }, 400 )
            }, function() {
           jQuery('.hover', this)
            .stop()
            .animate({
               opacity: 0
             }, 300)
             });                
          jQuery("#menu-main-navigation a").find('.hover').css({opacity:0})

提前谢谢你,

J

最佳答案

IE7 不支持opacity,你需要filter: alpha(opacity=50);

单独编码不安全,拿这个http://www.quirksmode.org/css/opacity.html

关于javascript - jQuery 导航在 IE7 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3764995/

相关文章:

html - Bootstrap 导航栏中/上方的中心 Logo

html - css only 复选框(带有内容属性)

javascript - 如何在 iframe 之外使用 jquery 应用 css

JQuery tagit 键盘导航不起作用

javascript - 即使在使用 javascript 重新加载后也保留滚动条位置

javascript - 从非类继承 ES6/TS 类

javascript - 将 4 个类似的点击功能合并为一个

html - 如何使用 Bootstrap 在另一个 DIV 的左侧显示 DIV

javascript - 关于导入名为 'url'的js模块

javascript - classed() 和 attr ("class"之间的区别)