我在一个网站上使用下拉菜单,除了 IE 之外它们都可以正常工作。
我花了过去两个小时试图解决这个问题,但我似乎无法解决问题所在。
我在菜单上使用了超级鱼,一旦你将鼠标移开链接,菜单就会在屏幕上停留大约 2-3 秒,而且位置有点偏离。
我在 ul 上尝试了 css 修复,但它只将其应用于 jquery 下拉列表,而不是剩余的实例。
这些图像说明了正在发生的事情;
这是菜单的css / html;
标记
<div class="main-menu">
<div class="menu-header">
<ul id="menu-main" class="menu sf-js-enabled">
<li id="menu-item-40" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-40">
<a class="sf-with-ul" href="http://wp.ashtonklein.com/ashton-klein/">
Ashton Klein
<span class="sf-sub-indicator"> »</span>
</a>
<ul class="sub-menu" style="visibility: hidden; display: none;">
<li id="menu-item-49" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-49">
<a class="sf-with-ul" href="http://wp.ashtonklein.com/ashton-klein/about/">
About
<span class="sf-sub-indicator"> »</span>
</a>
<ul class="sub-menu" style="visibility: hidden; display: none;">
<li id="menu-item-48" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48">
<a href="http://wp.ashtonklein.com/ashton-klein/about/who-we-are/">Who we are</a>
</li>
<li id="menu-item-47" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-47">
<a href="http://wp.ashtonklein.com/ashton-klein/about/our-vision/">Our Vision</a>
</li>
<li id="menu-item-46" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-46">
<a href="http://wp.ashtonklein.com/ashton-klein/about/our-commitment/">Our Commitment</a>
</li>
</ul>
</li>
<li id="menu-item-45" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-45">
<a class="sf-with-ul" href="http://wp.ashtonklein.com/ashton-klein/opportunities/">
Opportunities
<span class="sf-sub-indicator"> »</span>
</a>
<ul class="sub-menu" style="display: none; visibility: hidden;">
<li id="menu-item-44" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-44">
<a href="http://wp.ashtonklein.com/ashton-klein/opportunities/careers/">Careers</a>
</li>
<li id="menu-item-43" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-43">
<a href="http://wp.ashtonklein.com/ashton-klein/opportunities/franchising/">Franchising</a>
</li>
<li id="menu-item-42" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-42">
<a href="http://wp.ashtonklein.com/ashton-klein/opportunities/marketing-opportunities/">Marketing</a>
</li>
</ul>
</li>
<li id="menu-item-41" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-41">
<a href="http://wp.ashtonklein.com/ashton-klein/newsroom/">Newsroom</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
CSS
#header .webmenu .main-menu ul
{
width:100%;
height:40px;
}
#header .webmenu .main-menu ul li
{
float:left;
line-height:30px;
font-family: 'Philosopher', arial, serif;
font-size:18px;
height:30px;
margin:5px 15px 5px 0;
padding:0 10px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius: 4px;
position: relative;
z-index: 20px;
display:block;
}
#header .webmenu .main-menu ul li.current-menu-item, #header .webmenu .main-menu ul li.current-menu-parent, #header .webmenu .main-menu ul li.current-page-ancestor
{
background:url('../images/menu_current.png') repeat-x;
}
#header .webmenu .main-menu ul li a
{
color:#FFF;
text-decoration:none;
display:block;
outline:none;
}
#header .webmenu .main-menu ul li:hover
{
background:url('../images/menu_current.png') repeat-x;
}
#header .webmenu .main-menu ul li span.sf-sub-indicator
{
display:block;
float:right;
width:6px;
height:4px;
background:url('../images/menu_arrow.png') no-repeat right;
margin-left:10px;
margin-top:13px;
text-indent:-9999px;
}
#header .webmenu .main-menu ul li ul.sub-menu
{
position:absolute;
display:none;
/* corners */
border-radius:0 4px 4px;
-moz-border-radius:0 4px 4px;
-webkit-border-radius:0 4px 4px;
background:#007E63;
padding:5px;
height:auto;
width:200px;
}
#header .webmenu .main-menu ul li:hover ul.sub-menu
{
display:inherit;
left:0px;
top:28px;
}
#header .webmenu .main-menu ul li ul li
{
display:block;
float:none;
background:none;
margin-right:0;
padding:0 10px;
margin:0 0 3px;
}
#header .webmenu .main-menu ul li ul li:hover
{
background:#333333;
}
#header .webmenu .main-menu ul li ul li a, #header .webmenu .main-menu ul li ul li a:hover
{
color:#FFF;
}
#header .webmenu .main-menu ul li ul li.current-menu-item, #header .webmenu .main-menu ul li ul li.current-menu-parent
{
background:#333333;
}
#header .webmenu .main-menu ul li ul li span.sf-sub-indicator
{
background:url('../images/menu_arrow_sub.png'); background-repeat:no-repeat;
float:right;
margin-left:10px;
width:16px;
height:16px;
margin-top:8px;
text-indent:-9999px;
}
#header .webmenu .main-menu ul li ul.sub-menu li ul.sub-menu
{
position:absolute;
left:-999em;
/* corners */
border-radius:4px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
background:#007E63;
padding:5px;
height:auto;
width:200px;
}
#header .webmenu .main-menu ul li ul.sub-menu li:hover ul.sub-menu
{
left:200px;
top:0;
}
jQuery
$('ul.menu').superfish({
delay: 1000, // one second delay on mouseout
animation: {opacity:'show',height:'show'}, // fade-in and slide-down animation
speed: 'slow', // faster animation speed
autoArrows: true, // disable generation of arrow mark-up
dropShadows: false // disable drop shadows
});
感谢您提供的任何帮助!
http://www.stylishmedia.co.uk/ak/
这是测试版本的链接