【发布时间】:2012-09-26 02:09:21
【问题描述】:
我正在为一个新项目启动一个 Jquery 下拉菜单,它在 Google Chrome、Firefox、Safari 上按预期工作,但在 Internet Explorer 上它当然让我有些头疼。
事情是这样的, 看到这个页面 http://www.universidadedoingles.com.br/dev/index.ASP
鼠标悬停在 HOME 菜单上,下拉菜单出现,当您在 IE 中移动链接时,您会看到一些背景闪烁,这在 Chrome 和 ETC 上不会发生。
这是我用来做 dd 菜单的 js 尾声。
<script type="text/javascript">
$(document).ready(function() {
$("ul.mainmenu li.menuhome").mouseover(function(){
$(".arrow-spacer").show(); //When mouse over ...
//Following event is applied to the subnav itself (making height of subnav 150px)
$(this).find('.submenu').show().animate({height: '150px', opacity:'1'},{queue:false, duration:300})
});
$("ul.mainmenu li.menuhome").mouseout(function(){ //When mouse out ...
//Following event is applied to the subnav itself (making height of subnav 0px)
$(this).find('.submenu').hide().animate({height:'0px', opacity:'0'},{queue:false, duration:200})
});
//menu itembackground color animation
$("li").hover(function() {
$(this).animate();},
function() {
$(".arrow-spacer").hide();
});
});
</script>
就是这样,我想这可能很简单,但已经几周了,我仍然无法让它工作。
非常感谢。
【问题讨论】:
-
您测试过哪个版本的 Internet Explorer? my-debugbar.com/wiki/IETester/HomePage
-
我不明白为什么要在 li 元素悬停时隐藏“arrow-spacer”?
-
由于某种原因,如果我不使用那个 hide(),在我第一次悬停 HOME 链接后,箭头间隔不会消失。所以我需要箭头只是在我将鼠标悬停在链接上时显示并在鼠标移出时隐藏。
标签: javascript jquery html css drop-down-menu