我在主导航元素中有以下代码。它本质上是一个 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/