我正在尝试让下拉菜单在ie6中工作(在所有其他浏览器中都有效)。到目前为止,我可以让它同时打开(第二层+第三层)两个子菜单,但我不知道如何让它打开第二层,然后等待我悬停,然后再打开第三层。
它使用所有css,使用ul ul和ul display:none,直到它们被“发现”,使用这一行->
#access ul li:hover > ul {
display: block;
}这是我的jquery,它可以同时打开第二层和第三层:
jQuery(document).ready( function($) {
$('#access li').mouseover( function() {
$(this).find('ul').show();
});
$('#access li').mouseleave( function() {
$(this).find('ul').hide();
});
$('#access li ul').mouseleave( function() {
$(this).hide();
});
});如何使鼠标悬停只打开第二层,直到我将鼠标悬停在相应的按钮上打开第三层。
提前感谢!
PS我已经使用了几个插件(ie7.js,whatever.hover,csshover,ie6hover等),但他们破坏了页面上的其他代码,所以我想有一个简单的解决方案,只是菜单。
发布于 2011-03-29 04:20:43
我认为问题来自.find('ul'),它查找所有嵌套列表,而不是子列表。试着这样做:
jQuery(document).ready( function($) {
$('#access li').mouseover( function() {
$(this).children('ul').show();
});
$('#access li').mouseleave( function() {
$(this).find('ul').hide();
});
$('#access li ul').mouseleave( function() {
$(this).hide();
});
});https://stackoverflow.com/questions/5464197
复制相似问题