【发布时间】:2011-07-19 23:41:45
【问题描述】:
这是发生了什么(下面的代码块):
- 我正在开发一个简单的下拉导航(基于嵌套的 Ul)。
- 主 UL 的 ID 为 #nav。
- hover-> mouseout 函数不会触发(所有浏览器)
- 在 Chrome 12.0.742.122、Safari (5.05)、Opera (11.50)、IE (9.0) 中,第一次鼠标悬停后,任何 后续 鼠标悬停不 动画(即 slideDown) .8)。事实上,它ONLY 似乎在 Firefox (5.0) 中有效。
- 我仅在 Windows (7) 上进行了测试。还没有 mac...。
- 让动画再次工作的唯一方法是刷新到页面。
- 我从一年多前发布的 Nettuts tutorial 中了解到这一点,不敢相信它已经过时了。
- 仅供参考:我在我的 html 页面底部调用 jQuery 和下面的脚本。
- 另一个仅供参考:我仍然相当绿色,所以清晰回应会非常有帮助
有什么想法吗? 提前致谢, 卧铺
var site = function(){
this.navLI = $('#nav > li').children('ul').css('display','none').end();
this.init();
};
site.prototype = {
init: function(){
this.setMenu();
},
// enables the slide down menu and adds support for ie6
setMenu: function(){
this.navLI.hover(function(){
// mouseover
$(this).find('> ul').stop(true, true).slideDown(250);
}, function(){
// mouseout
$(this).find('> ul').stop(true, true).fadeOut(200);
});
}
}
new site();
【问题讨论】:
-
您发布了在 UI 上呈现的内容?如果您可以粘贴您的 UI 和 HTML 的屏幕截图,那就太好了。我会给你一个分数。 [|:-)>--|
-
能发fiddle就太好了
-
那就写吧,就这么写吧!给我一点时间。
-
我认为我正确地做了这个小提琴(小提琴很酷,顺便说一句)。 jsfiddle.net/YCezK
标签: jquery