我的下拉菜单在除 IE 之外的所有浏览器中都可以正常工作。我可以看到在开发人员工具中触发了悬停功能,但由于某种原因,菜单实际上并不可见。我已经以我能想到的所有方式调整了 CSS……有什么我忽略的吗?
该网站是:http ://www.ironbridgeband.com
音乐自动播放(不是我的选择),所以要小心你的音量 根据开发者工具,IE9 是浏览器模式。
编辑:这是使用的 CSS 和 JQuery:
/*
LEVEL ONE
*/
#navigation > ul {text-align: center; position: relative;}
#navigation > ul li{
float: left;
background: transparent;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#00990000,endColorstr=#00990000);
zoom: 1;
z-index: 0;
}
#navigation > ul a:hover {color: #000;}
#navigation > ul a:active {color: #fff;}
#navigation > ul li a {display: block;}
#navigation > ul li.hover,
#navigation > ul li:hover {color: #fff; position: relative; }
#navigation > ul li.hover a {color: #FFF;}
/*
LEVEL TWO
*/
ul.children{
list-style-type: none;
font-size: 0.8em;
width: 100%;
visibility: hidden;
position: absolute;
top: 50px;
z-index: 500;
margin-left: 0px !important;
padding-left: 0px !important;
line-height:2em;
background: transparent !important;
}
ul.children li{
font-size: 16px;
text-transform: none;
font-weight: normal;
float: none !important;
clear: both;
font-weight: bold;
background: #158082;
color: #fff;
border: none;
float: none;
margin-left: -25px !important;
padding: 0 !important;
z-index: 501;
}
ul.children li.hover{
background-color: transparent !important;
}
/* IE 6 & 7 Needs Inline Block */
ul.children li a{
border-right: none;
display: inline-block;
width:auto;
}
* jQuery: *
$(function(){
var config = {
sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)
interval: 100, // number = milliseconds for onMouseOver polling interval
over: doOpen, // function = onMouseOver callback (REQUIRED)
timeout: 200, // number = milliseconds delay before onMouseOut
out: doClose // function = onMouseOut callback (REQUIRED)
};
function doOpen() {
console.log("doOpen()")
$(this).addClass("hover");
$('ul:first',this).css('visibility', 'visible');
$('ul:first',this).css('z-index', '100001');
}
function doClose() {
console.log("doClose()")
$(this).removeClass("hover");
$('ul:first',this).css('visibility', 'hidden');
}
$("#navigation > ul li").hoverIntent(config);
$("#navigation > ul li ul li:has(ul)").find("a:first").append(" » ");
});